Reputation: 525
Is there a way to set the onClick to return to the previous page, rather than a specific page?
I have a print friendly page that is linked to by multiple pages. It would be nice if when users click "Back" they are returned to the page they just came from.
Upvotes: 1
Views: 764
Reputation: 6347
Absolutely, here is a function that you can add to your client script file and call from any widget event handler:
/**
* Navigates user to a previous page.
*/
function goBack() {
window.history.back();
}
Upvotes: 1