Jump to content

why is getElementById("blah") null?


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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...