Is your client looking for a programming or design skill that you don't have? Refer a project to us, earn up to $10,000 in referral commission.
Geekpedia Tutorials Home

Building a C# Chat Client and Server

Building a C# Chat Client and ServerA step by step tutorial teaching you how to create your own chat client and chat server easily in C#, for local networks or the Internet.

in C# Programming Tutorials

Getting Hard Drive Information

Getting Hard Drive InformationA C# tutorial showing you how to make use of WMI to extract information on disk drives, such as model, capacity, sectors and serial number.

in C# Programming Tutorials

UPS Shipping Calculator

UPS Shipping CalculatorThis tutorial will teach you how to calculate the shipping cost based on the weight, height, length and depth of the box, the distance and the UPS service type.

in PHP Programming Tutorials

Create Your Own Rich Text Editor

Create Your Own Rich Text EditorCreating a Rich Text Editor using JavaScript is easier to do than you might think, thanks to the support of modern browsers; this tutorial will walk you through it.

in JavaScript Programming Tutorials
Programming Tutorials
IT Jobs
From CareerBuilder

How to go back one page in the browser history using JavaScript

On Friday, March 17th 2006 at 02:48 PM
By Andrew Pociu (View Profile)
*****   (Rated 4.4 with 39 votes)
More JavaScript Resources
Using JavaScript you can go back or forward in the browser's navigation history. Most of the time you want to go back one page by clicking a link in the page. For doing that, use the following code:

<a href="javascript:history.go(-1)">Go back</a>

It's easy to figure out that to go back more pages in history, you use a different negative number (-2, -3, -4, etc.). To go forward you use a positive number (1, 2, 3, etc.); in the example below we go one page forward in the browser's history:

<a href="javascript:history.go(1)">Go forward</a>
Digg Digg It!     Reddit Reddit     StumbleUpon StumbleIt     Newsvine Newsvine     Furl Furl     BlinkList BlinkList

Rate Rate this Knowledge Base article
Comment Current Comments
by tom on Friday, April 21st 2006 at 09:57 AM

nice, didn't knew that one yet
thx ;)

by Jen on Monday, May 15th 2006 at 04:27 PM

Don't you mean "Go Forward" in the second example?

by Andrei Pociu on Monday, May 15th 2006 at 04:52 PM

Yes, I did, thanks for pointing that out. It\'s now fixed.

by on Friday, February 16th 2007 at 04:34 PM


by Raoul on Wednesday, May 16th 2007 at 07:31 PM

Multumesc. :)

by shark on Thursday, November 29th 2007 at 07:43 AM


by anudeep on Saturday, March 15th 2008 at 05:39 AM

this is really useful....

by Eskalibur on Thursday, March 5th 2009 at 05:31 AM

Thanks very much!

by ajaz on Wednesday, April 15th 2009 at 02:18 AM

really simple and working as well

by Sai on Wednesday, June 3rd 2009 at 12:01 AM

Thanks Alot

by Gurunath on Saturday, June 20th 2009 at 04:26 PM

Mind Blowing . . .

I have one requirement,
Is it possible to go back to a perticular page by using its any property identification?


by Morten Aase on Thursday, July 30th 2009 at 02:49 AM

How do I make It go back to same location on page ???

by Morten Aase on Thursday, July 30th 2009 at 02:49 AM

How do I make It go back to same location on page ???

by Shameer on Thursday, October 8th 2009 at 09:08 AM

This great but not working in Google chrome and some versions of mozila

by Vishal on Saturday, October 24th 2009 at 04:42 AM

That's great , but if we have tab option in my page and one tab decalre the pop up then it will not work?

by ytu on Monday, March 29th 2010 at 02:47 AM


by retheeshmeda on Friday, April 9th 2010 at 08:58 AM

Thanks Alot

by Sudharma on Monday, April 19th 2010 at 05:07 AM

thank u very much!
you have solved my big problem.

by Wd on Wednesday, May 19th 2010 at 04:24 AM

Walla Walla kya karti

by Wd on Wednesday, May 19th 2010 at 04:25 AM

Walla Walla kya karti

by shambhu on Wednesday, July 28th 2010 at 03:54 AM


by on Monday, October 4th 2010 at 12:37 AM


by sundar on Friday, December 3rd 2010 at 11:18 PM

how can interact with "Go back one page" button in address bar..pls help me ..

by GK on Monday, January 24th 2011 at 11:06 AM

history.go(-1); is not working for me. I am using IE8. Any clues.

by GK on Monday, January 24th 2011 at 11:06 AM

history.go(-1); is not working for me. I am using IE8. Any clues.

by Andrea on Tuesday, February 1st 2011 at 02:06 PM

Thank you!

by rolleyes.jpg on Sunday, September 25th 2011 at 10:08 AM

@Andrea, yeah, not really.

by RachaelRowland on Thursday, October 13th 2011 at 11:17 AM

I will recommend not to wait until you get big sum of cash to order all you need! You can take the <a href="">credit loans</a> or sba loan and feel yourself comfortable

by on Thursday, January 19th 2012 at 05:42 AM

Once you have recreated the problem and captured these steps, you can save them to a file and send it to your support person, who can then open it up and view

Comment Comment on this Knowledge Base article
Name: Email:
Knowledge Base Related Knowledge Base Articles
There are no related KB articles.

Comment Related Source Code
There is no related code.

Comment Related Tutorials
There are no related tutorials.

Jobs JavaScript Job Search
My skills include:

Enter a City:

Select a State:

Advanced Search >>
Discover Geekpedia