I have the following code in the html:
<div id="image-internal">
The I have the following code in my javascript:
parent = $("#" + type + "-" + location);
parent.empty();
parent.empty() in IE only, is returning a JavaScript error, saying “Object doesn’t support property or method ’empty’. All other browsers (FireFox/Chrome/Safari) correctly set parent to the div object and allow the empty() call.
What can be causing IE to behave this way? and how do I fix it?
Thanks in advance.
change the name of the variable or define it using the
var-keyword.parentis a built-in property ofwindow.