【发布时间】:2016-01-24 15:20:32
【问题描述】:
你能帮忙找出为什么 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>
【问题讨论】:
-
开发者控制台有错误吗?
-
可能是因为
$(...).pjax is not a function错误