Knockout.js Attr绑定

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="js/jquery-1.11.1.min.js"></script>
    <script src="js/knockout-3.3.0.js"></script>
    <script type="text/javascript">
        var viewModel = {
            url: ko.observable("HtmlPage10.html"),
            details: ko.observable("Report including final year-end statistics")
        };
        $(function () {
            ko.applyBindings(viewModel);
        })
    </script>
</head>
<body>
    <a data-bind="attr: { href: url, title: details }">Report
    </a>
</body>

 

posted on 2015-08-17 15:14  YuanSong  阅读(1637)  评论(0编辑  收藏  举报

导航