javascript - document.getElementById() returns null on IE9 -



javascript - document.getElementById() returns null on IE9 -

i'm working on popup , i'm having hard time net explorer 9. piece of code gives me trouble:

var popup= document.getelementbyid('projectinfo'); popup.style.left=(tempx-310)+'px'; popup.style.top=(tempy-110)+'px';

in ie9 (haven't tested in prior versions), popup null. in adition, i've tried including .js file before body closing tag , wrapping function in "document.ready()" function none of worked. same code though works in opera, chrome , firefox. know what's going on?

note: function called in body's onload atribute of html.

without using function can't work

window.onload = function() { var popup= document.getelementbyid('projectinfo'); popup.style.left=(tempx-310)+'px'; popup.style.top=(tempy-110)+'px'; }

javascript internet-explorer getelementbyid

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -