2011-07-14 39 views
2

我在firebug中得到以下錯誤:不支持jQuery 1.6.2與操作錯誤「代碼:」9。首先可以有人告訴我這個錯誤的確切含義?其次,我正在做的是使用對話框來顯示一個表格,該表格很好顯示,但每當我點擊一個輸入字段時,就會觸發這個錯誤。我重視我的代碼,並會成爲一些指導感激:jQuery 1.6.2錯誤與操作不支持「代碼:」9

的jQuery 1.6.2 jQuery的UI 1.8.14

// Help function 

function help() { 

    $(function() { 

     $('#feedback').dialog({ 
      resizeable: true, 
      title: "Mail Help", 
      width: 500, 
      height: 420, 
      modal: true, 
      overlay: { 
       backgroundColor: "#000", 
       opacity: 0.3 
      } 


     }); 
     $("feedback").dialog('open'); 
    }); 
} 


// Feedback form 
<div id="form" style="display:none;"> 
    <form method="post" id="feedback" class="webform" name="feedback"> 


     <label for="company">Company</label> 
     <select name="company" id="company"> 
       <option SELECTED VALUE="">Select an option</option> 
       <option value="Technical">Technical</option> 
       <option value="Database">Database</option> 
       <option value="Error">Error</option> 
       <option value="Other">Other</option> 
     </select> 
     <label for="name">Full Name:</label> 
       <input id="uname" name="uname" type="text" class="text ui-widget-content ui-corner-all inputbox uname" value="<?php echo $_SESSION['kt_name_usr']; ?>" /> 
     <label for="email">Email address:</label> 
       <input id="email" name="email" type="text" class="text ui-widget-content ui-corner-all inputbox email" value="<?php echo $_SESSION['kt_email_usr']; ?>" /> 
     <label for="position">Position:</label> 
       <input id="position" name="position" type="text" class="text ui-widget-content ui-corner-all inputbox position" /> 
     <label for="feedbacknew">Feedback:</label> 
       <textarea id="feedbacknew" name="feedbacknew" cols="25" rows="3" type="text" class="text ui-widget-content ui-corner-all inputbox feedbacknew">Please make sure that any error messages or numbers are listed here </textarea><br /> 

     <button id="submit" class="submit">Submit</button> 
     <div id="message"></div> 
    </form> 
</div> 
+0

也許試圖讓FORM到對話框是問題(不確定),試試DIV而不是 – 2011-07-14 10:27:58

+0

@pezhavk沒有任何區別。謝謝 – bollo

+0

似乎工作得很好: http://jsfiddle.net/petersendidit/VWbE9/1/ – PetersenDidIt

回答

2

找到如何解決它在我的一些情況。

在jQuery中源(未分)找到此塊:

if (document.documentElement.contains) { 
    Sizzle.contains = function(a, b) { 
     return a !== b && (a.contains ? a.contains(b) : true); 
    }; 

} else if (document.documentElement.compareDocumentPosition) { 
    Sizzle.contains = function(a, b) { 
     return !!(a.compareDocumentPosition(b) & 16); 
    }; 

} else { 
    Sizzle.contains = function() { 
     return false; 
    }; 
} 

,並添加的try-catch它爲什麼會發生,你可以在例外部分閱讀herereturn !!(a.compareDocumentPosition(b) & 16);

if (document.documentElement.contains) { 
    Sizzle.contains = function(a, b) { 
     return a !== b && (a.contains ? a.contains(b) : true); 
    }; 

} else if (document.documentElement.compareDocumentPosition) { 
    Sizzle.contains = function(a, b) { 
     try { 
      return !!(a.compareDocumentPosition(b) & 16); 
     } 
     catch (e) { 
      return false 
     } 
    }; 

} else { 
    Sizzle.contains = function() { 
     return false; 
    }; 
} 

相關問題