<br/>
<ul id="menu" class="clearfix">
<li class="current"><a href="/">Home</a></li>
<li><a href="seattle">Seattle</a></li>
<li><a href="new-york">New York</a></li>
<li><a href="london">London</a></li>
</ul>
<br/>
<script>
// THIS IS WHERE THE MAGIC HAPPENS
$(function() {
$('nav a').click(function(e) {
$("#loading").show();
href = $(this).attr("href");
loadContent(href);
// HISTORY.PUSHSTATE
history.pushState('', 'New URL: '+href, href);
e.preventDefault();
});
// THIS EVENT MAKES SURE THAT THE BACK/FORWARD BUTTONS WORK AS WELL
window.onpopstate = function(event) {
$("#loading").show();
console.log("pathname: "+location.pathname);
};
});
</script>
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
You are not working thru a web browser since the error URL starts with file:///C:/Users/miles.wil
If you put your code on a web server, it might start working. It at the very least will not have that particular error message.
A complicated document about browser security and restrictions: http://code.google.com/p/browsersec/wiki/Part2