2016-01-13 49 views
0

你可以幫助找到爲什麼pjax不工作?pjax例如不工作

https://plnkr.co/edit/CfB9rIKP7EknVNDiYZpR?p=preview

後,我點擊一個鏈接,它只是轉到頁(正常鏈路)

<!DOCTYPE html> 
<html> 

    <head> 
    <link rel="stylesheet" href="style.css"> 
    <script src="https://code.jquery.com/jquery-2.2.0.min.js"></script> 
    <script src="https://raw.githubusercontent.com/defunkt/jquery-pjax/master/jquery.pjax.js"></script> 

    </head> 

    <body> 
    <h1>Hello Plunker!</h1> 
    <div class="container" id="pjax-container"> 
      Go to <a href="bla.html">next page</a>. 
      </div> 
    </body> 
<script> 
$(document).ready(function(){ 
    $(document).pjax('a', '#pjax-container') 
}); 
</script> 
</html> 
+0

Developer Console中的任何錯誤? – Raptor

+0

可能是因爲'$(...)。pjax不是函數錯誤 – Dhara

回答

0

你必須把你的pjax容器在這樣的bla.html頁:

<div class="container" id="pjax-container"> Go to <a href="bla.html">next page</a>. </div>

它將現在的作品。

+0

完全像bla頁

test
user3371212