| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Path is a lightweight, client-side routing library that allows you to create "single page" applications using Hashbangs and/or HTML5 pushState.
function clearPanel(){
// You can put some code in here to do fancy DOM transitions, such as fade-out or slide-in.
}
Path.map("#/users").to(function(){
alert("Users!");
});
Path.map("#/comments").to(function(){
alert("Comments!");
}).enter(clearPanel);
Path.map("#/posts").to(function(){
alert("Posts!");
}).enter(clearPanel);
Path.root("#/posts");
Path.listen();Any of the examples above confuse you? Read up on the details in the wiki.
You can find examples on the official Github Page.
To run the tests, simply navigate to the ./tests folder and open the HTML file in your browser. Please note that the HTML5 History API is not compatible with the file:// protocol, and to run the tests in the tests/pushstate folder, you will need to run them through a webserver such as nginx or Apache.
MIT
| Back | FazBrowse Home | New Git URL |