navigation_pushstate.html (606B)
1 <!-- This Source Code Form is subject to the terms of the Mozilla Public 2 - License, v. 2.0. If a copy of the MPL was not distributed with this 3 - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> 4 5 <!DOCTYPE html> 6 <html> 7 <head> 8 <title>Navigation by manipulating the browser history</title> 9 <script type="text/javascript"> 10 function forward() { 11 let stateObj = { foo: "bar" }; 12 history.pushState(stateObj, "", "navigation_pushstate_target.html"); 13 } 14 </script> 15 </head> 16 17 <body> 18 <p>Navigate <a onclick="javascript:forward();" id="forward">forward</a></p> 19 </body> 20 </html>