My javascript to jQuery translation has a bug

Posted by donpal on Stack Overflow See other posts from Stack Overflow or by donpal
Published on 2010-04-03T15:05:00Z Indexed on 2010/04/03 15:13 UTC
Read the original article Hit count: 317

Filed under:
|

My guess is that this javascript just finds the div called divid and then uses it with the sendit function.

var somevalue = 19; 
if (navigator.appName.indexOf("Microsoft") != -1) {
    thediv = window["divid"]; 
} else { 
    thediv = document["divid"];
}
thediv.sendit(somevalue);

I would imagine in jQuery it would look something as simple as this:

var somevalue = 19;
$('divid').sendit(somevalue);

But it's not working!! What could I be missing?

I should say that it's in the middle of other javascript code, could that be a problem?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript