私は2つのリンクを持つデフォルトのデモを使用し、アラートを出しました。今ではハッシュとタイトルのプラグインが含まれています。私のコードは次のとおりです。
<script type="text/javascript">
Davis.extend(Davis.hashRouting({ prefix: "!"}));
var app = Davis(function () {
this.use(Davis.title);
this.configure(function () {
this.generateRequestOnPageLoad = true
});
this.get('/welcome/:name', function (req) {
alert("Hello " + req.params['name']);
this.setTitle(req.params['name']);
});
});
app.start();
</script>
<a href="#!/welcome/oliver">greet oliver</a> //link 1
<a href="#!/welcome/bob">greet bob</a> //link 1
リンクをクリックすると、次の場所にリダイレクトされます。http:// localhost /%23!/welcome/bob#!/welcome/bob 問題は何ですか?:(