Jump to content

why is getElementById("blah") null?


mwbarry

Recommended Posts

in other words. If you are going to have javascript execute on the page, and you are certain that the element exists, it's probably because your JS is running before the DOM has finished loading. If you are using jquery you can use $(document).ready(function(){}) or else use window.onload and make sure all your code is executing within na function assigned to window.onload instead. Let us know if none of that makes sense, lol. :)

Link to comment
Share on other sites

in other words. If you are going to have javascript execute on the page, and you are certain that the element exists, it's probably because your JS is running before the DOM has finished loading. If you are using jquery you can use $(document).ready(function(){}) or else use window.onload and make sure all your code is executing within na function assigned to window.onload instead. Let us know if none of that makes sense, lol. :)
perfect thanks!
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...