javascript

Is this browser-dependent javascript code?

Why different output in IE and FF? In IE its showing : Hello and In FF its showing : Hi var message = "Hi"; setTimeout(function(){alert(message);},10); setTimeout(function(){message = "Hello";},0); what is standarad? which browser is doing it right? Note: if i convert 10 to 11 in FF then it shows Hello ...

Need validation for a form in PHP not in Javascript?

Hai.. i already added javascript validation for my form.Its working fine.But mean while i ve to validate the same form using PHP also. This is the form code: class airportclass{ function add_airport_frm(){ $errmsg=0; <table> <form action="" method="post" name="airport" > <tr> <td colspan="2" align="center"><?php echo $err...

jquery: context with closures?

Hi there! I got a simple question about jQuery but rather javascript approaches in general... Is it ok, to do this? : this._checkedTexts.length = 0; // <- array belonging to "me" var contextCheckedTexts = this._checkedTexts; $('#valueContainer input:checked').each(function() { contextCheckedTexts.push($(this).text()); }); Since '...

ajax modalpopupextender with firefox 3.6 gets displayed on the bottom of page

Hi. I have a modalpopup extender that works on IE (8) and does not work on FF I have searched google for hours but I could not find a solution yet. I do have this code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; at the start of the page. And this is t...

Editing prompt in javascript

i am creating a web application in which i have to show an editing prompt while user want to navigate from the page?But only when users had edited some value on that page and he does not save the changes then the prompt will ask "Do you want to save the changes ?".otherwise if he saved then the prompt does not appear? Editing prompt simi...

this keyword in a class method

var mC = function(map){ var init = function(iMap){ alert("Init " + this + " with"); } init(map); }; var m = new mC({}); why i am getting value of this as [object window]? Is it a window object?? ...

calling a javascript function inside a .js file which resides in a iframe

Hi, i have a default.aspx page which contains a iframe, whose source is set to a default.htm page. The default.htm in turn has a link to a script file(). Is it possible to access the functions in the script file in my default.aspx page ?if so how ?? ...

jquery click event does not work when content is overwritten using ajax

I have explained the problem below this code <div id='content'> <div id='help'> blah blah blah once there lived a king named midas blah blah blah </div> <script> $(document).ready(function() { $('#help').click( function () { $('help').hide(500); }) }) </script> <!-- bottom of the page after a long other content -->...

I'm playing around with different design patterns in Javascript. This factory has got me confused.

Hey Team, I'm playing around with different JS design patterns, and im trying to modify some samples I've seen out there. I saw an example of a xhr factory, that had several nested try/catch statements that were nested within eachother. try{ ... }catch(e){ try{ ... }catch(e){} } I figured I'd be able to do a self-invoking...

Valid Object Constructors

which of the following are valid object constructors? 1) var m = function(){} 2) m = function(){} 3) m.prototype.constructor = function(){} ...

Graph Goat Teleportation Data with Google Vis. API via Chrome Extension

I just checked my Chromium task manager and noticed that my Goats Teleported count is abnormally high. I thought it might be a good idea to create a browser extension that runs the goat teleportation data through Google Visualizations API and generates some nice reports so I can track it easily and make sure it doesn't get out of hand. ...

How to encode a value that is rendered to page and finally used in URL?

I have a script that is rendered to an html page as a part of a tracking solution (etracker). It is something like this: <script> var et_cart= 'nice shoes,10.0,100045;nice jacket,20.00,29887'; </script> This will be transmitted to the server of the tracking solution by some javascript that I don't control. It will end up as 2 items. ...

How to draw a circle and search within the circle on a Google Maps API?

On my web page I have already a Google Maps API with a search bar (see code below) and at first the user pinpoints an address. Then the User is be able to search businesses around this point with a search bar. Before search is complete I'd like to draw a circle around this address for instance with a distance of 15 km. The search should ...

IE won't toggle element

I have this javascript on my page to toggle a div and switching between two images <script type="text/javascript"> fuction toggleArchiv() { document.getElementById('cat').toggle(); var image = document.getElementById('arrow'); if (image.src == 'bullet_arrow_down.png') { image.src = 'bullet_arrow_up.png'; } else { ...

What is the best JavaScript image processing library ?

Hi, I need some kick-ass effects for my web site, like gaussian blur, noise, convolution filters, morphological operations etc. All effects must be applied dynamically (no pre-renderend images) and being changed over time. What is the most powerful image processing library, implemented in JavaScript ? ...

HTML5 Audio Visualizer?

Is there such a player? I'm looking into making one purely out of JavaScript. Something like http://www.nihilogic.dk/labs/pocket_full_of_html5/ but randomly all mashed together? What are your thoughts? ...

How to invert the forecolor and backcolor when any one of them changes

I am using a ajaxtoolkit to choose a color. I want to set the forecolor of the text as the reverse of backcolor. if a black has been choosen as backcolor then its corresponding forecolor should be set to white and vice versa. I want to do this with javascript <script type="text/javascript"> function colorChanged(sender) { // ...

javascript to find the caller div. (or any other dom object)

I have the following html page: <div id="a" onclick ="javascript:click();">a</div> <div id="b" onclick ="javascript:click();">b</div> <div id="c" onclick ="javascript:click();">c</div> Now, The javascript function: function click() { // how do I know if it was 'a' , 'b' or 'c' to call me } Does anybody know how to find (in ev...

Match part of img src when comes into dom and add a class to a <p> tag that matches - jquery

I've got an ajax loaded image gallery that loads an image to the dom and then removes it and loads in the next one and rotates in that way. Next to where the image comes in i've got a list of static names (they're there on page load and don't do anything) for the images. What i want to do is as the image is loaded into the dom, i want ...

How does the scrolling on "Google Maps for Mobile" work?

See http://www.google.com/gmm - the scrolling is super smooth even with floating toolbars. How are they accomplishing this with GWT? ...