2013-10-28 42 views
0

我想添加和刪除標籤動態非常像這樣 jquery dynamic tabs除了我是 使用jquery 1.5.2。但標籤面板(div標籤)被一個接一個添加。我發現問題出在新版本的jquery中添加的刷新調用。我在閱讀thisthis後嘗試使用tabify。但我得到了一個錯誤說;在jquery 1.5.2

Uncaught TypeError: Object [object Object] has no method 'tabify' 

那麼有沒有其他辦法呢?

+1

tabify未定義..請確保您加載tabify.js .. – bipen

+0

我找到了整個過程的替代方案。 jquery支持在最新版本中棄用的$(selector).tabs('add',tabcontent,tablabel)。我正在嘗試使用它 – programer8

回答

0

有幾件事你可以試着讓它工作。

Be ABSOLUTELY sure your script is being pulled into the page, one way to check is by using the 'sources' tab in the Chrome Debugger and searching for the file. 

    Be sure that you've included the script after you've included jQuery, as it is most certainly dependant upon that. 

除此之外,我檢查了API,你肯定做的一切正確,據我所知。祝你好運!

編輯:確保關閉腳本標記。下面有一個答案指出這是解決方案。

的優先順序必須是下列:

jQuery.js 
Everything that depends on jQuery. 

它看起來像你得到了錯誤的(看着這個問題你的代碼)。將其更改爲:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="js/jquery.timepicker.min.js"></script>