2017-06-22 43 views
-1

我使用jQuery的分頁下面的腳本:尋呼是不是一個函數

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> 
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script> 
<script src="~/Scripts/paging.js"></script> 

,但下面的錯誤出現:

Uncaught TypeError: $(...).paging is not a function 

我不知道這個問題可能是什麼。雖然加載paging.js似乎代碼沒有看到該文件。

+0

把$( '#elementId')。尋呼呼叫並在$(文件)。就緒{}。如果這不是競爭條件問題,請確保插件已正確註冊。 –

+1

你怎麼知道paging.js被加載?在瀏覽器的開發工具中檢查客戶端。我懷疑〜/路徑存在問題,或者首先加載訂單/準備就緒,一旦排除,將$()。分頁調用的代碼部分添加到您的文章中 – dlatikay

+0

我使用此腳本調用函數 $(document).ready(function(){('#tableData')。paging({limit:5}); }); – Sereen

回答

0

使用此代碼,它爲我工作。

我想你可能不會得到jQuery的語法正確

<script type="text/javascript"> 
    $(document).ready(function(){ 
     $('#table-demo').paging({limit:7}); 
    }); 
</script>