views:

53

answers:

2

hi,

just i want to make back button in my site. once i click the button it need to take the url in to previous page. how can i make this using jquery?

+4  A: 
<a href="javascript:history.back();">
wRAR
Side note: this is straight Javascript, not jQuery. There are completely history plugins designed using the jQuery plugin framework, but they are meant to handle ajax and your history (to not break the back button on a single page that behaves as many pages).
justkt
+1  A: 

Hi,

the answer by wRAR is correct, use can use history.back or history.go(-1). However, if you are using ajax, you might need a bit more than that.

Stephen Walter has a nice article on how to use jQuery and Browser History which basically describes how to save and restore the application state yourself. I recommend you give a read.

Elijah Manor(co-host of the Official jQuery Podcast) has also written a nice article about this topic.

I hope this helps -D

Diego C.
Thanks for given the very good information..
3gwebtrain