2010-05-10 66 views
5

我使用jQuery UI的1.8倍,得到這個錯誤在Internet Explorer中:' 「數據(...)選項爲空或不是對象」 中的jQuery UI的

Webpage error details 

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E) 
Timestamp: Mon, 10 May 2010 06:26:48 UTC 


Message: 'data(...).options' is null or not an object 
Line: 75 
Char: 13074 
Code: 0 
URI: http://localhost:58365/Scripts/Lib/jquery-ui-1.8.custom.min.js 

是這是一個已知的錯誤?有沒有解決方法? 當我使用droppable/draggable時會發生錯誤。

回答

3

嘗試幾件事情:

如果你嘗試了ready處理,但還是得到了這個錯誤,請嘗試load甚至代替:

$(window).load(function(){ 
    // your code here 
}); 

或者試試把你的jQuery/js代碼,在結束這一頁。

1

檢查this question。我有類似的東西,因爲在我們的拖放功能中,我們做了ui.draggable.remove()。這意味着jQuery不再有任何工作了。

+0

我有這個問題在下降一個刪除。這是一個IE8特定的問題,在IE9中一切正常。 – 2012-01-31 15:39:50

2

jquery.min.js取代:

stop: function(event, ui) { 
    var o = $(this).data('draggable').options; 
    if (o._cursor) $('body').css("cursor", o._cursor); 
} 

有了:

stop: function(event, ui) { 
    if ($(this).data('draggable')) { 
     var o = $(this).data('draggable').options; 
     if (o._cursor) $('body').css("cursor", o._cursor); 
    } 
} 
+1

在我的版本中,它的語法不完全相同('d(this).data(「draggable」)'),但它解決了這個問題。謝謝! – Samuel 2012-10-29 09:03:57

相關問題