2013-02-20 91 views
2

我已將jQuery 1.7.1替換爲jQuery 1.9.2,並且我看到以下錯誤與我的一些自定義構建UI腳本和jQuery提供的UI庫以及。以下是錯誤。從jQuery 1.7.1遷移到jQuery 1.9.2

而且我已經升級了jQuery UI庫1.10.0

以下內容是我一直面臨有更多的錯誤。

Uncaught TypeError: Cannot read property 'element' of undefined 
'e.widget._close' 
(anonymous function) 
e.widget.close 
(anonymous function) 
'_on.blur' 
u 
b.event.dispatch 
v.handle 

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

cannot call methods on myCustomOverlay prior to initialization; attempted to call method 'isOpen' 

是否有任何事情我必須注意?請指導我如何從1.7.1遷移到1.9.1

+0

非常含糊,請提供代碼。 – Dom 2013-02-20 19:37:12

+0

你提到的錯誤聽起來像你會從使用舊的(過時的)插件與jQuery 1.9 – 2013-02-20 19:38:02

+4

1)您是否已經閱讀了升級指南http://jquery.com/upgrade-guide/1.9/。 – dgvid 2013-02-20 19:38:09

回答

4

很多舊的代碼庫已經完全更新,或者在最新的1.9版本中不推薦使用,並且因爲已經創建了遷移插件可用於恢復一些已刪除的功能,以幫助您將項目轉換爲更新版本的jQuery。

你可以在他們的官方下載頁here找到jQuery Migrate插件。您還可以使用@dgvid提到的遷移指南here

+0

我想我必須先通過遷移指南並更換插件,感謝所有人的幫助。我一直在尋找遷移的一般想法和最佳實踐,因爲我知道我所做的不是隻需複製最新版本並將其放入代碼庫即可,如果您有更多有用的內容,請添加評論。 – 2013-02-20 21:58:35