javascript

Extra text shown on oveflow: hidden

I'm keeping the main content area of the webpage small, so that footer navigation can be seen "above the fold". This is done by javascript setting the main content <div> thus: sec.style.height = '265px'; sec.style.overflow = 'hidden'; And then using javascript to insert a button to change the style back to normal: sec.style.height = ...

How to propagate a click from an invisible div to an embeded flash ?

Hi, i need to propagate a click from an invisible div to an embeded flash (the two are superposed). <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="600"> <param name="src" value="pub.swf"> ...

need help, twitter post wont show up

can somebody help me with these codings... this code work at another twitter account, but when i try to retrive post from "goelalifest" twitter account, it wont show up. <div id="twitter_update_list"></div> <script src="http://twitter.com/javascripts/blogger.js" type="text/javascript"></script> <script src="http://twitter.com/statuses/u...

Insert random <script> for using $(document).ready(function()}); in Joomla

Hi I have an article in which I use PHP code inside the text editor in Joomla, in the backend. I can see jQuery already called when the page loads, here is my code inside the Article edit textbox: <?php $username="XXX"; $password="XXX"; $database="XXX"; mysql_connect('localhost',$username,$password) or die(mysql_error()); mysql_select...

JavaScript/jQuery removing character 160 from a node's text() value - Regex

$('#customerAddress').text().replace(/\xA0/,"").replace(/\s+/," "); Going after the value in a span (id=customerAddress) and I'd like to reduce all sections of whitespace to a single whitespace. The /\s+/ whould work except this app gets some character 160's between street address and state/zip What is a better way to write this? this ...

run postback only once with javascript

I have to do a postback automatically when a user visit a page. How can I run this postback only once? javascript:__doPostBack('dnn$ctr424$ViewLogin$btChange','') ...

ExternalInterface.addCallback doesn't work on firefox??

i'm trying to call a method inside a flash movie from js, every time the mouse leaves the "div". It works on Internet Explorer, but not in firefox. any ideas? here is the html script: <script type="text/javascript"> window.onload = function(e){ init(); } function init(){ document.getElementById('div').on...

Google's Geocoder returns wrong country

Hi I'm using Google's Geocoder to find lat lng coordinates for a given address. var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address, 'region': 'uk' }, function(results, status) { if(status == google.maps.GeocoderStatus.OK) { lat: results[0].geometry.lo...

Understanding try..catch in Javascript

I have this try and catch problem. I am trying to redirect to a different page. But sometimes it does and some times it doesnt. I think the problem is in try and catch . can someone help me understand this. Thanks var pg = new Object(); var da = document.all; var wo = window.opener; pg.changeHideReasonID = function(){ if(pg.hideReason...

How to iterate javascript object properties in the order they were written.

Hi. I identified a bug in my code which I hope to solve with minimal refactoring effort. This bug occurs in Chrome and Opera browsers. Problem: var obj = {23:"AA",12:"BB"}; //iterating through obj's properties for(i in obj) document.write("Key: "+i +" "+"Value: "+obj[i]); Output in FF,IE Key: 23 Value: AA Key: 12 Value: BB Output i...

How to use various selectors in SIFR 3r436

Hi, i'm using this sIFR.replace(neutra, { selector: '#nav li', css:[ 'a { color: #ffffff; text-decoration:none; font-size:14px} a:hover { color: #d75a60; text-decoration:underline;}'], wmode: 'transparent', preventWrap: true ,forceWidth: true ,fitExactly: true ,forceSingleLine: true ,offsetTop: 0 ,offsetLeft: 0 ,tuneWidth: 0 ,tune...

How can I break an email address into different parts in php?

Basically what I want to do is display an email using javascript to bring the parts together and form a complete email address that cannot be visible by email harvesters. I would like to take an email address eg [email protected] and break it to: $variable1 = "info"; $variable2 = "thiscompany.com"; All this done in PHP. Regards, JB...

How can I stop a default event when using a named function in addEvent?

Normally, if I wish to stop a default event in mootools I can do this: $('form').addEvent('submit', function(e) { e.stop(); //Do stuff here }); However, I don't like using an anonymous function in events because I often want to reuse the code. Lets say I have a validate function. I could do this: $('form').addEvent('subm...

JSON Response {"d":"128.00"} but displaying "128"

Hi all, I have been working on a shopping cart that the user can add/remove order items as they please and am returning an updated sub-total via a webservice using jQuery $.ajax Here is how I am calling the webservice and setting the sub-total with the response. //perform the ajax call $.ajax({ url: p, data: '{' + s + '}', ...

how to use ajax with json in ruby on rails

I am implemeting a facebook application in rails using facebooker plugin, therefore it is very important to use this architecture if i want to update multiple DOM in my page. if my code works in a regular rails application it would work in my facebook application. i am trying to use ajax to let the user know that the comment was sent, ...

jquery ajax encoding problem!

hi, i send ajax requests with jquery, and i have a function: $('input').ajaxSuccess(function(e, xhr, settings) { console.log(xhr.responseText); }); Ajax response ara russian letters in utf-8, all server (apache, php) and files are in utf-8 but response text is something like this: \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c...

How do I disable or enable 2nd dropdownlist in aspx based on selected choice of the 1st dropdownlist box

I am having a problem with disabling DropDownList based on the chice of 1st DropDownList, there is no post back occuring, and it is a template based web app here is the current code: <script type="text/javascript"> $(function() { var dropDownList1 = $('#<%= ddlUserType.ClientID %>'); var dropDownList2 = $('#<%= ddlMember.ClientID %>...

splice() not working on correctly

I am setting a cookie for each navigation container that is clicked on. It sets an array that is joined and set the cookie value. if its clicked again then its removed from the array. It somehow buggy. It only splices after clicking on other elements. and then it behaves weird. It might be that splice is not the correct method Thanks...

python interactive web data/forms/interface communicating with remote server

What's an efficient method (preferably simple as well) for communicating with a remote server and allowing the user to 'interact' with it (IE submit commands, user interface) via the web browser (IE a text box to input commands, and an text area for output, or various command-less abstracted interfaces)? I have the 'standalone' python c...

uploadify response problem

in my php I evaluate the the filesize if (($width !=1600) || ($height !=1100)) { echo "wrongsize"; } else { echo "justright"; } in my file i try and evaluate the the response to update the html 'onComplete' :function(event, queueID, fileObj, response, data) { if(response == "wrongsize") { $('div#uploadError').ht...