Last active
December 23, 2015 09:49
-
-
Save jdlich/6616845 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype HTML> | |
<head> | |
<title></title> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/path.js/0.8.4/path.min.js"></script> | |
<script> | |
Path.map('#/').to(function() { | |
yield('home'); | |
}); | |
Path.map('#/:view').to(function() { | |
yield(this.params['view']); | |
}); | |
Path.root('/'); | |
Path.listen(); | |
function yield(view) { | |
var content = 'views/' + view + '.html'; | |
$("#yield").load(content, function() { | |
$(this).children().first().unwrap(); | |
}); | |
} | |
</script> | |
</head> | |
<body> | |
<header></header> | |
<div id="content"> | |
<div id="yield"></div> | |
</div> | |
<footer></footer> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment