A
Andrew Phillipo
I have some code that works everywhere but IE5.0, including IE5.5.
Here is a snippet of where the code seems to go wrong:
Location.prototype.change = function(current) {
this.current = current; // refers to the currently selected estate
agent
var elem = dhtml_get_element(this.id()); // cross browser
getElementById
var oldElem = elem.parentNode; // we can't replace tables using
innerHTML - get the parent element (a div)
oldElem.innerHTML = this.html(); // set the innerHTML
return false;
};
This function is executed when an estate agent is selected under a
property (onclick) - it replaces one of the blocks of code with the
output of this.html().
This works in every browser, even in IE5.0 the content changes. However
in 5.0 before the content changes I get a javascript error:
---------------------------
Error
---------------------------
A Runtime Error has occurred.
Do you wish to Debug?
Line: 0
Error: Object required
---------------------------
Yes No
---------------------------
This error NEVER goes away and keeps reappearing whatever is clicked.
Debugging does not give me anymore information; instead saying that it
cannot debug inside an anonymous function ... which I don't think is
being used.
What I think is happening is that IE internally refers somewhere to the
elements created on the page and replacing them causes it it to throw a
wobbly.
I have also tried creating a new element and setting the innerHTML on
that, then using replaceChild to change the document, but to no avail.
Hopefully someone can help me before I turn to self harm!
Thanks a LOT guys.
Here is a snippet of where the code seems to go wrong:
Location.prototype.change = function(current) {
this.current = current; // refers to the currently selected estate
agent
var elem = dhtml_get_element(this.id()); // cross browser
getElementById
var oldElem = elem.parentNode; // we can't replace tables using
innerHTML - get the parent element (a div)
oldElem.innerHTML = this.html(); // set the innerHTML
return false;
};
This function is executed when an estate agent is selected under a
property (onclick) - it replaces one of the blocks of code with the
output of this.html().
This works in every browser, even in IE5.0 the content changes. However
in 5.0 before the content changes I get a javascript error:
---------------------------
Error
---------------------------
A Runtime Error has occurred.
Do you wish to Debug?
Line: 0
Error: Object required
---------------------------
Yes No
---------------------------
This error NEVER goes away and keeps reappearing whatever is clicked.
Debugging does not give me anymore information; instead saying that it
cannot debug inside an anonymous function ... which I don't think is
being used.
What I think is happening is that IE internally refers somewhere to the
elements created on the page and replacing them causes it it to throw a
wobbly.
I have also tried creating a new element and setting the innerHTML on
that, then using replaceChild to change the document, but to no avail.
Hopefully someone can help me before I turn to self harm!
Thanks a LOT guys.