This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Stop browsers asking to resend form data on refresh?
how to disable browser refresh confirmation message [resend cancel] from javascript .?
Rather than having the user refresh the entire page, you might consider using AJAX and provide your own refresh button. It likely will make refreshing quicker as well because the entire page does not have to be reloaded.
Related
This question already has answers here:
Identifying Between Refresh And Close Browser Actions
(13 answers)
How can I detect browser tab refresh or close using javascript [duplicate]
(3 answers)
Closed 7 years ago.
How can I distinguish browser close and reload/refresh/f5 though jQuery/JS? I want to update database (via ajax) when close browser/tab and keep all as it is when reload.
What I am doing now is same action running when reload or close. But after reload again run a restore function (via ajax) to set back in previous state.
Tried How can I detect browser tab refresh or close using javascript not worked. Any Idea? cron job is not real time. I need real time action
Professionals help please how you handle this issue.
This question already has an answer here:
universal javascript for set homepage functionality [duplicate]
(1 answer)
Closed 7 years ago.
I need a javascript code for this function.
When a user visits the website , a window pops up with a message asking the user to set a website as HOME PAGE for their browser.
ok here is the script you need:
Set as homepage
for a button use this code:
<button onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.yoursite.com');">Set as homepage</button>
But dont put it in a code where it popsup every time a user visits the page. It is a bad practice.
This question already has answers here:
How do I modify the URL without reloading the page?
(20 answers)
Closed 9 years ago.
As far as I know it's not possible to change a URL in the address bar without redirecting a page (only updating fragments will work), but in Pinterest.com it seems like only a modal dialog is opened when clicking on a post, and at the same time the URL is updated to ".../post/12356789". I'm curious how do they achieve that?
Thanks!
It's probably done using the history.pushState() method in "HTML5", which lets you manipulate the browser history (to some extent). Here's an article detailing how it works.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Cross-browser onload event and the Back button
How can I force a view/page to refresh when a user clicks browser back to that page?
use onunload
<body onunload="alert(unloading page')"></body>
This question already has answers here:
Is there a cross-browser onload event when clicking the back button?
(15 answers)
Closed 9 years ago.
What event can i use to run code when a user visits another page then hits back to load my page again?
I wrote window.onload = function() { ... and it works when i hit refresh but not forward then back.
This jQuery plugin is pretty good. http://www.asual.com/jquery/address/docs/
And here's some info on the underlying JavaScript events involved in it's implementation http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript