When I click links in my site it works in major browsers, but IE9 and lower do not work. I click the links and nothing happens! Console says: "event.returnValue is deprecated. Please use the standard event.preventDefault() instead."
I'm using this method from this website: http://sudojesse.github.io/dynamic-page/index.html
when I use this website in IE9 and lower it works (with refreshing the page, but it works!). What am I doing wrong?
EDIT: When putting everything in a subfolder it works! Could it be something with htacess?
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<script type='text/javascript' src='js/modernizr.js'></script>
<script>$(function() {
if(Modernizr.history){
var newHash = "",
$mainContent = $("#main-content"),
$pageWrap = $("#page-wrap"),
baseHeight = 0,
$el;
$pageWrap.height($pageWrap.height());
baseHeight = $pageWrap.height() - $mainContent.height();
$( "a" ).on("click", function() {
_link = $(this).attr("href");
history.pushState(null, null, _link);
loadContent(_link);
return false;
});
function loadContent(href){
$mainContent
.find("#guts")
.fadeOut(200, function() {
$mainContent.hide().load(href + " #guts", function() {
$mainContent.fadeIn(200, function() {
$pageWrap.animate({
height: baseHeight + $mainContent.height() + "px"
});
});
});
});
}
$(window).bind('popstate', function(){
_link = location.pathname.replace(/^.*[\\\/]/, ''); //get filename only
loadContent(_link);
});
} // otherwise, history is not supported, so nothing fancy here.
});</script>
Try: