-3

I want to Implement Back button Similar to how the browser . I don't have any idea on how to Do this . Please suggest me a way whether i can do it in java script .

user3095218
  • 39
  • 1
  • 9

3 Answers3

5

try

   <input onclick='javascript:window.history.back()' value='Back' type='button' />

   <input onclick='javascript:window.history.forward()' value='Next' type='button'  />

this is simple javascript.

Note this will not work in following cases:

  1. History is cleared
  2. Open in new browser
  3. Ajax based websites, as no history is maintained for ajax driven applications.
A.T.
  • 24,694
  • 8
  • 47
  • 65
  • I want a buttton like thing a the bottom of my page . So that whenever a user clicks back . It just goes to the previous page or Next button for forward page – user3095218 Apr 16 '14 at 05:34
1

Try this:

<button onclick="window.history.back()">Go Back</button>
slavoo
  • 5,798
  • 64
  • 37
  • 39
kondapaka
  • 132
  • 1
  • 10
1

Here it is

<button type="button" onclick="window.history.go(-1);">Back</button>
ASasd
  • 119
  • 1
  • 8