director.js 传递多个参数

来源:互联网 发布:servo guide软件下载 编辑:程序博客网 时间:2024/06/05 06:38
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>A Gentle Introduction</title>
    <script src="https://rawgit.com/flatiron/director/master/build/director.min.js"></script>
    <script>
      var    viewBook = function(bookId,bookId2) { console.log("viewBook: bookId is populated: " + bookId+"="+bookId2); };


      var routes = {
        '/books/view/:bookId/:bookId2': viewBook
      };
      var router = Router(routes);
      router.init();
    </script>
  </head>
  <body>
    <ul>
      <li><a href="#/books/view/bookId1/bookId2">两个参数</a></li>
    </ul>
  </body>
</html>
0 0