Jump to content

Go back to any page *TIP


dreamwest

Recommended Posts

Just wanted to share the best javascript for page history return.

 

A lovely and simple line anyone can remember:

 

<a href="javascript:history.go(-1);">previous page</a>

 

You can set this to return to any page the user has previously browsed set "(-1)" to how far back you want the hyperlink to take you

 

 

Link to comment
https://forums.phpfreaks.com/topic/139488-go-back-to-any-page-tip/
Share on other sites

Um, okay . . .

 

That's a pretty well known JavaScript function. You can also go forward in the browser history using a positive integer (assuming the user, or javascript, has gone back in the history)

 

yeah. i was using php code to tell where the user came from.....this is simpler though

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.