单页面应用程序案例
http://m.maoyan.com/#type=movies
url从/?tmp=movie换成了#
1 document.getElementById("b").addEventListener("click", function() { 2 this.href = this.href.replace("?", "#"); 3 });
http://m.ctrip.com/webapp/hotel/
总的来说分为两种方式
1./#!/index
/#!/about
---------
/#about
/#index
/#hotel
2.history.pushState
history.replaceState
window.addEventListener("hashchange", function() {}, false);------->特别重要,采用事件冒泡
出处:http://cnblogs.com/daishuguang