Partial.js Client-side Routing
Https://github.com/petersirka/partial.js-clientside
The Framework supports the HTML 5 history APIs, for older browsers (ie8+) URLs hashtag is automatically enabled. This plugin was a Little Big cannon for the Web development. Works with JQuery.
- Easy-to-use
- Minified only 9.5 KB (without GZIP compression)
- Great functionality
- Great use
- Works in IE 8+
- No dependencies
- DEMO EXAMPLE
Compact and easy to use powerful, good compatibility, for the old browser, that does not support the HTML5 SPA history API Browser, automatically degraded to hash route.
To view the example page:
http://source.858project.com/contact/
Simple example
// ===========================DEFINE ROUTING// ===========================Framework = = = Global variableFramework.Route'/homepage/', View_homepage, [' Contact‘]);Framework.Route'/services/', View_services, [' Contact‘]);Framework.Route'/contact/', View_contact, [' Empty‘]);Framework.Route'/products/{category}/', View_products, [' Latest‘]);// ===========================DEFINE PARTIAL CONTENT// ===========================Framework.Partial' Contact‘,function () {$(' #panel‘).html' PANEL Contact‘);});Framework.Partial' Empty‘,function () {$(' #panel‘).html' PANEL EMPTY‘);});Framework.Partial' Latest‘,function () {$(' #panel‘).html' PANEL LATEST‘);});// ===========================DEFINE views// ===========================functionView_homepage () {$(' #content‘).html' Homepage‘);}functionView_services () {$(' #content‘).html' SERVICES‘);}functionView_contact () {$(' #content‘).html' Contact‘);}functionView_products (category) {$(' #content‘).html' Products–>‘+ category);}// ===========================DEFINE EVENTS// ===========================Framework.On' Ready‘,function () {$('. Menu‘).On' Click‘,' A‘,functionE) {E.Preventdefault ();E.Stoppropagation ();Framework.redirect$(This).attrframework. redirect ( '/homepage/framework. on ( ' Location ", function (url) {var menu = $ ( "Menumenu. find ( "Selected"). Removeclass ( ' selected '); Menu.find (' a[href= ' + URL + '] '). Parent (). AddClass (' selected ');
Partial.js Client-side Routing (client-side routing-History API based on HTML5 Spa features)