![](/img/trans.png)
[英]jQuery working in Chrome and Safari, but not Firefox or IE?
[英]JQuery not returning div in IE, but Firefox/Chrome/Safari is?
我在html中有以下代碼:
<div id="image-internal">
我的javascript中有以下代碼:
parent = $("#" + type + "-" + location);
parent.empty();
僅在IE中的parent.empty()返回JavaScript錯誤,並指出“對象不支持屬性或方法“空”。所有其他瀏覽器(FireFox / Chrome / Safari)正確將父對象設置為div對象並允許為空()致電。
是什么導致IE以這種方式運行? 以及如何解決?
提前致謝。
更改變量的名稱或使用var
-keyword定義它。 parent
是window
的內置屬性。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.