lugos Posted November 28, 2005 Share Posted November 28, 2005 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 More sharing options...
Chocolate570 Posted November 28, 2005 Share Posted November 28, 2005 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 More sharing options...
lugos Posted November 28, 2005 Author Share Posted November 28, 2005 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?<{POST_SNAPBACK}> That sounds like it could work. I'll give it a shot. Link to comment Share on other sites More sharing options...
lugos Posted November 28, 2005 Author Share Posted November 28, 2005 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?<{POST_SNAPBACK}> By the way, how could I check what url it came from?Thanks,lugos Link to comment Share on other sites More sharing options...
Skemcin Posted November 28, 2005 Share Posted November 28, 2005 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 More sharing options...
Chocolate570 Posted November 29, 2005 Share Posted November 29, 2005 By the way, how could I check what url it came from?Thanks,lugos<{POST_SNAPBACK}> 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now