View Full Version : Re: Back button and Refresh
02-05-2004, 01:30 AM
Does anyone know any script to take the visitor back to the previous page, after that refreshing that page??
02-05-2004, 01:42 AM
Well here's the code for going back a page.
<input type="button" value="Back" onclick="history.go(-1); return false;">
02-05-2004, 05:46 AM
With all due appriciation, but you forgot to tell me how would I refresh that page??
02-05-2004, 06:47 AM
Do you mean you want to go back one page then refresh that page? You can't exactly do that, just go to that page again.
<input type="button" value="Back & Refresh" onclick="if (document.referrer) location.href=document.referrer">
Take note that document.referrer does not work if the page is run offline. You must run it online (intranet or internet)
02-05-2004, 05:38 PM
Sorry, i didn't know how to do the refresh so i gave you what i know.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.