PathJS 轻量级 Web 浏览器路由

程序名称:PathJS

授权协议: MIT

操作系统: 跨平台

开发语言: JavaScript

PathJS 介绍

PathJS 是个轻量级的,客户端路由库,允许你创建 “单页”应用,使用 Hashbangs 和/或者 HTML5 pushState。

主要特性:

  • 轻量级

  • 支持 HTML5 History API, ‘onhashchange’ 方法和平滑的 degredation

  • 支持根路由,rescue methods, paramaterized routes, optional route components (dynamic routes), and Aspect Oriented Programming

  • 经过了很好的测试 (测试示例请看 ./tests 目录)

  • 兼容所有主流浏览器(通过了 Firefox 3.6, Firefox 4.0, Firefox 5.0, Chrome 9, Opera 11, IE7, IE8, IE9 的测试)

  • 独立于所有第三方库,但是又能很好的与第三方库结合使用

简单示例:

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();

PathJS 官网

http://mtrpcic.github.io/pathjs/

相关编程语言

MuPlayer 是一款跨平台、轻量级的音频播放解决方案,...
OS FLV 是一个 开源和可嵌入网页的flv播放器。 这个...
DewPlayer音乐播放器,样式很简单,而且很实用.播放器...
JW FLV MEDIA PLAYER是一个开源的在网页上使用的Fla...
Speakker 是一个基于 Web 浏览器的音乐播放器,只提...
Player Framework 是一个开源的支持 HTML5 的视频播...