0
default.html中
<html>
<head>
</head>
<body>
<script src="jquery-2.1.0.min.js"></script>
<script src="json2.min.js"></script>
<script src="underscore.js"></script>
<script src="backbone.js"></script>
<script>
Router = Backbone.Router.extend({
routers: {
"*action" : "func"
},
func: function (action) {
console.log(action);
}
});
new Router();
Backbone.history.start();
</script>
</body>
</html>
按照routers
格式它具有#
後打印到console
後綴。
例如對於路徑default.html#hello
它必須在console
上打印hello
,但實際上沒有打印。
這裏有什麼問題?
哎呀...謝謝。 – URL87