2013-09-25 64 views
0

我在包含網格的網頁上使用jQuery v2.0.1,並且在頁腳處有一個「Search」ImageButton。在grid_RowCommond事件中,我將使用下面的腳本在彈出窗口中顯示搜索結果,當用戶單擊其中一個搜索結果時,選定的結果將返回到父頁面的頁腳行,彈出窗口將會顯示關閉。我在IE10上測試了這個函數,它完美地工作,直到用戶反饋他們在IE8底部看到javascript錯誤。僅在IE8中出現jQuery錯誤對象不支持此屬性或方法

請幫幫我。

protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) 
{ 
    if (e.CommandName == "Search") 
    { 
     TextBox txtNo = grid.FooterRow.FindControl("txtNo") as TextBox; 

     System.Text.StringBuilder s = new System.Text.StringBuilder(); 
     s.Append("<script language='javascript' id='SearchResult'> "); 
     s.Append("var WinSettings = 'dialogHeight:400px ; dialogWidth: 550px ;center: Yes ;resizable: No;status: no'; "); 
     s.Append("javascript: var windowReturnValue =window.showModalDialog('Search.aspx?car_no=" + txtNo.Text.Trim().ToUpper() + "','',WinSettings);"); 

     s.Append("$('#" + txtNo.ClientID + "').val(windowReturnValue) ;"); 
     s.Append("</script > "); 

     if ((!ClientScript.IsStartupScriptRegistered("SearchResult"))) 
     { 
      ClientScript.RegisterStartupScript(this.GetType(), "SearchResult", s.ToString()); 
     }      
    } 
} 
+0

什麼是錯誤的IE 8支持

? – Abhitalks

回答

0

jQuery 2.x已經刪除了IE8的支持,使用的是最新的1.x穩定版本的jQuery; 1.10.2

相關問題