View Full Version : Re: Back button and Refresh
02-05-2004, 02:30 AM
Does anyone know any script to take the visitor back to the previous page, after that refreshing that page??
02-05-2004, 02: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, 06:46 AM
With all due appriciation, but you forgot to tell me how would I refresh that page??
02-05-2004, 07: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, 06: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 © 2016 vBulletin Solutions, Inc. All rights reserved.