How to "window.history.back();" in to button?


(Thomas) #1

I would like to incorporate the script from http://www.w3schools.com/jsref/met_his_back.asp in to a button on a scene.

How do i go about making a button perform the documented function?


(Greg) #2

Try looking here…


(Thomas) #3

Sorry i probably wasn’t clear enough in my initial post. I would like to have the button perform the back function to the previous item in their browsing history. So send them back to the site they came from before reaching mine.


(Greg) #4

Ooppsss. Try

window.history.go(-1);

It won’t work while previewing because nothing will be in the history

You can test it by going forward, – preview your hype file then go to google.com then hit the back button to go back to you Hype preview with a button that has this script attached to it.

window.history.forward();

(Thomas) #5

Your a legend :grin: