can we check that page is refresh using javascript
-
Hi, I have some code in javascript, which i dont want to execute on page refresh. How can i check that page is refresh using javascript Thanks in advance Yrishi
Page refresh means the page will be again retrieved from the server. If one presses ctrl +f5 it will even remove browser cache and then load everything. so if you want to restrict running a function on page refresh, it will automatically blocked on first run, as it would be unable to check if it is run first or refreshed. One thing that you can do, is set a cookie in the browser after the page is loaded for first time, then from serverside remove the script when cookie is present. :)
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml> -
Hi, I have some code in javascript, which i dont want to execute on page refresh. How can i check that page is refresh using javascript Thanks in advance Yrishi
Hi, Why do you want to know the page is refresh, or what do you want to do? If you just want to check the page is refresh, I suggest you creat a variable and change its value when the page is postback, and use js to check it.
April Comm100 - Leading Live Chat Software Provider
-
Hi, Why do you want to know the page is refresh, or what do you want to do? If you just want to check the page is refresh, I suggest you creat a variable and change its value when the page is postback, and use js to check it.
April Comm100 - Leading Live Chat Software Provider
Thanks for your reply. Actually I am using window.open method in my application.It is working perfect if i close my browser.But if page will get refreshed or if i navigate in my application then also window.open is executing. Please help me on this