By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

innerHTML, IE5.0, Error 'Line: 0 Error: Object required

P: n/a
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.

Sep 27 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Andrew Phillipo wrote:
I have some code that works everywhere but IE5.0, including IE5.5. Location.prototype.change = function(current) { 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.


On the right hand side of your above assigment you have an anonymous
function.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 27 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.