2013-02-27 51 views
3

我在我的asp .net mvc應用程序中使用了knockout,現在我想要設置pagerjs。下面的說明,我已經加入HTML的這一部分中主要佈局PagerJs - page-href在href路徑中添加undefined

<ul class="nav" data-bind="foreach: $__page__.children"> 
        <li> 
         <a data-bind="page-href: $data"> 
        </li>    
</ul> 

我的導航菜單,我有這在我的部分觀點:

<div data-bind="page: {id: 'start', title: 'My Applications', alt:'My applications'>...</div> 
<div data-bind="page: {id: 'statistics', title: 'My statistics', alt:'My statistics'>...</div> 

然而,當它呈現HTML我得到了以下結果:

<a data-bind="page-href: $data" href="undefinedstart"> 
<a data-bind="page-href: $data" href="undefinedstatistics"> 

並且我的開始div不可見。

我不明白爲什麼這個未定義顯示?任何幫助?

感謝

回答

3

我忘了我的DOM的頂部添加

<base href="absolute-URI-to-index.html/"/> 

。我發現它查看了pagerjs代碼。不過,我切換到jquery.haschange避免添加基地標籤到我的HTML。

BR,

Minja