I was following along with Jeffery Way’s history.pushState tutorial on Tuts+, however I’m not able to get his results.
Basically, here is my test page: http://leongaban.com/_tuts+/HTML5/
With the script at the bottom of the page, the URL is suppose to look like http://leongaban.com/_tuts+/HTML5/page however nothing happens, also in Chrome and Firefox the developer tools are telling me there is no JavaScript on the page?
My full markup (same as Jeffery’s):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>History – pushState</title>
</head>
<body>
<ul>
<li><a href="http://d2o0t5hpnwv4c1.cloudfront.net/2086_get-good-with-php/preview.png" title="Rockable">Rockable</a></li>
<li><a href="http://tutsplus.s3.amazonaws.com/bestof/bestoftuts.jpg" title="Best">Best of Tuts</a></li>
<li><a href="http://net.tutsplus.com/wp-content/uploads/2012/06/200x200.png" title="Advanced JS">Advanced JS</a></li>
</ul>
<script type="text/javascript">
history.pushState(
'Some data'
'My Page Title'
'page'
);
</script>
</body>
</html>
<!--
<script>
history.go(-1); < Go back 1 page
history.go(2); < Go forward 2 pages
history.go(0); < Refresh current page
history.forward(); < Forward 1 page
history.back(); < Back 1 page
</script>
-->
You need to pass commas into that function, to seperate the variables you are passing to pushState