Jump to content

onload help


lugos

Recommended Posts

Hello All,I have an onload function that I only want to execute one time. If the user happens to navigate to the next page but then hits the back button, I do not want the onload function to execute again. I tried setting a global javascript boolean variable but that did not work. Does anyone have any suggestions? Any help would be greatly appreciated.Thanks again,lugos

Link to comment
Share on other sites

Well, you can figure out the URL of the place you came from, and if it's not a specific url, then don't let it use the onload function. Is that what you're looking for?

Link to comment
Share on other sites

have you tried setting/incrementing a cookie onload and having the onload function check the value of the cookie to determine whether or not to execute?

Link to comment
Share on other sites

By the way, how could I check what url it came from?Thanks,lugos

Let me figure that out, one second.....I'll edit this post.Ahh, from what I see, i think what you want is document.referrer. That will give you the site that you came from. :)
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
×
×
  • Create New...