Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <title>Fun with Back!</title>
- <link rel="stylesheet" type="text/css"
- href="http://o.aolcdn.com/dojo/1.1/dojo/resources/dojo.css" />
- <script
- type="text/javascript"
- src="http://o.aolcdn.com/dojo/1.1/dojo/dojo.xd.js"
- djConfig="dojoIframeHistoryUrl:'iframe_history.html',isDebug:true"
- ></script>
- <script type="text/javascript">
- dojo.addOnLoad(function( ) {
- initialState = {
- back: function( ) { console.log("Back to initial state"); }
- };
- //set the initial state and move forward two steps in history
- dojo.back.setInitialState(initialState);
- i=1;
- dojo.back.addToHistory({
- back: function( ) { console.log("Back to state "+this.changeUrl); },
- forward: function( ) { console.log("Forward to state "+this.changeUrl); },
- changeUrl : 'state'+i
- });
- i++;
- dojo.back.addToHistory({
- back: function( ) { console.log("Back to state "+this.changeUrl); },
- forward: function( ) { console.log("Forward to state "+this.changeUrl); },
- changeUrl : 'state'+i
- });
- });
- </script>
- </head>
- <body>
- <script type="text/javascript"
- src="http://o.aolcdn.com/dojo/1.1/dojo/back.js"></script>
- <script type="text/javascript">dojo.back.init( );</script>
- Press the back button and have a look at the console.
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement