Jump to content

onload event for <div> tag?


Zaper Gallis
 Share

Recommended Posts

I'm making a script that starts out in a login page. once you click enter it uses Ajax to replace the log in with a display that then uses Ajax to load messages inside that display every second. The issue is because the display is loaded after the body tag i cannot use the onload event to fire the function, nor do i want the user to have to click something to load the display. is there a equivalent to the onload function that can be placed inside a <div> or <table> to start the function?

Link to comment
Share on other sites

Placing a script immediately inside or after the element that you want to load will make it run as soon as the element is added to the DOM.I'm not sure if I understood correctly, but you shouldn't have anything outside of the body tag.

Link to comment
Share on other sites

Placing a script immediately inside or after the element that you want to load will make it run as soon as the element is added to the DOM.I'm not sure if I understood correctly, but you shouldn't have anything outside of the body tag.
I didn';t mean out side the body tags, but i meant out side the <body> opening. Thanks.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...