1
我想使用this tuto,但不爲我工作JavaScript框架canJs control.route
$(function() { Router = can.Control({ "completed route" : function(){ console.log("the hash is #!completed") }, "active route" : function(){ console.log("the hash is #!active") }, "project/create" : function(){ console.log("the hash is #!project/create") }, "route" : function(){ console.log("empty hash") } }); // make sure to initialize the Control new Router(document); });
我用window.location.hash = "!#completed"
或<a href="#!active">Show Active</a>
顯示在控制檯沒有消息。
我用canjs 2.0.4用jQuery
感謝幫助
是, 有用 !謝謝你的幫助Daff – Phane