2011-02-17 102 views
1

我正在嘗試創建一個登錄頁面,其中多個元素都觸發了一個jQuery UI窗體,同時還有一個計時器彈出窗體。Internet Explorer 9中的jQuery UI對話框錯誤rc1

它似乎工作在除IE9之外的所有東西,這是奇怪的,因爲IE9是迄今爲止最好的! (< /蠕蟲>)

我使用

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script> 
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js"></script> 
<script type="text/javascript"> 
    $(function(){ 

     var signup_step = '<?= $step ?>'; 

     $('#signup-lightbox').dialog({ //line 31 
      width: "457px", 
      modal: true, 
      autoOpen: false, 
      closeText: '', 
      position: ['center','top'] 
     }); 
//etc 
</head> 
<body> 
<div id="signup-lightbox"><!-- etc --></div> 

SCRIPT438:對象不支持屬性或方法 '的getElementsByTagName'
jquery.min.js 16行字符59007
SCRIPT438:對象不支持屬性或方法'對話框'
landing1,line 31 character 21

有人對此有任何建議嗎?我有點困惑,因爲我從來沒有遇到與jQuery不在IE中工作的問題。我想這可能是一個IE9rc1的bug,在這種情況下,就這樣吧。

修改, 我要補充我的觸發代碼..

$('#navigation a, .profile a, .profile > img, .profile > h2').click(function(e){ 
    e.preventDefault(); 
    amendForm(); 
    openLightbox(); 
}); 

if($('#signup-lightbox').dialog("isOpen") == false && (signup_step == 'index' || signup_step == undefined)){ 
    setTimeout(function(){ 
      amendForm(); 
      openLightbox(); 
     }, 3000); 
} 
+0

確保你的jQuery UI庫正在從CDN加載。 – Stephen 2011-02-17 21:56:23

回答

0

this blog post,jQuery UI的1.8.7+只支持jQuery的版本到1.4.4。

您正在使用jQuery 1.5。

展望UI 1.8.8和UI 1.8.9的發佈說明,我沒有看到關於進一步jQuery支持的任何說明,所以我認爲UI 1.8.9仍然只與jQuery 1.4.4兼容。

我會降級jQuery到1.4.4,看看錯誤是否仍然存在。