Skip to content

Instantly share code, notes, and snippets.

@dvwright
Last active December 13, 2016 21:00
Show Gist options
  • Save dvwright/4982163aeb949d0d503c4c1ee6916c5f to your computer and use it in GitHub Desktop.
Save dvwright/4982163aeb949d0d503c4c1ee6916c5f to your computer and use it in GitHub Desktop.
Navigo IE11 Navigation Example - does not work as expected
RewriteEngine On
Options +FollowSymLinks
IndexIgnore */*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="../lib/navigo.min.js"></script>
<script>
var router = new Navigo(root = null, useHash = true);
 
$(document).ready(function() {
function load_projects(loc){
console.log(loc);
$("#app").empty();
$("<h2>", {
html: loc
}).appendTo('#app');
}
router.on({
'': function() {
load_projects('root');
},
'/n': function() {
load_projects('/n');
},
'/p': function() {
load_projects('/p');
},
'/u': function(params) {
load_projects('/u');
}
}
).resolve();
 
});
</script>
<body>
<h2>Navigo Test:</h2>
<ul>
<li>In Chrome/FF/Opera/Safari/IOS, "Location" displays the page navigated to</li>
<li>in IE11 it does not</li>
<li>also demonstrated via console.log</li>
</ul>
<div><h3>Location :</h3>
<div id='app'>app</div>
</div>
<br/>
<h3>Navigation</h3>
<a href='#/'>/</a><br/>
<a href='#/n'>/n</a><br/>
<a href='#/p'>/p</a><br/>
<a href='#/u'>/u</a><br/>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment