473,766 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.protot ype.change = function(curren t) {
this.current = current; // refers to the currently selected estate
agent
var elem = dhtml_get_eleme nt(this.id()); // cross browser
getElementById
var oldElem = elem.parentNode ; // we can't replace tables using
innerHTML - get the parent element (a div)
oldElem.innerHT ML = 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
1 4176


Andrew Phillipo wrote:
I have some code that works everywhere but IE5.0, including IE5.5. Location.protot ype.change = function(curren t) { 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2628
by: Nick | last post by:
OK. I've had a trawl through past messages but can see nothing that helps me, so...here goes... I am writing a web application which, among other things, pushes a web page to a user's browser. In very simple terms: - I have a script in hidden frame A which sets the document.location of main frame B.
6
10156
by: adamrfrench | last post by:
Let it be mentioned that Javascript is not my forte, so the solution to this could very well be a simple one. I am working on an AJAX function where I can pass a URL and the target ID in, and have the function update the target ID with the URL. There is a bit more to it then that, but that is the basics. my difficulty comes when I try to assign a variable to: "document.getElementById('-> var gose here <-').innerHTML"
16
13345
by: Joel Byrd | last post by:
I am having this ridiculous problem of trying to set the innerHTML of a div node. It works in all other browsers, but internet explorer is giving me an "Unknown runtime error". This is actually in the context of developing an auto-suggest (basically reverse-engineering Google Suggest), but I don't see how any of the other code has anything to do with it. I *pretty sure* that I've narrowed it down to 1 line (the line on which the...
5
3735
by: Dennis Fazekas | last post by:
Greetings, I am creating a web form which will all the user to add an unlimited number of email addresses. Basically I have 3 buttons, "Add Another Email", "-" to remove, and a "Save" button. When the user clicks the "Add another email" it will call a client side JavaScript function, add_email, which will dynamically add a new set of controls to the webpage using the innerHTML method. It appears to work perfectly fine in the browser. The...
9
8671
by: Hallvard B Furuseth | last post by:
Why does the FAQ (Q 4.15) recommend innerHTML when so many here say one should use createElement(), replaceChild() etc? Also, why does the "Alternative DynWrite function" at <http://www.jibbering.com/faq/faq_notes/alt_dynwrite.html> need such a lot of tests to find out if innerHTML assignment actually works, instead of just inserting <span id="strange name"></span> and checking if the document now contains an element with that ID?
1
2198
by: huzheng001 | last post by:
I have develop a on-line dictionary website, http://www.stardict.org I meet a problem: Here is two lines of js codes: document.getElementById("wordlist").innerHTML = ""; document.getElementById("definition").innerHTML = "line1<br>line2"; The corresponding html codes are: <table width="100%"> <tr> <td width="25%" valign="top"><div id="wordlist" width="100%" style=' overflow-y:auto; height:352px;'></div></td>
2
4757
by: m0nkeymafia | last post by:
I have spent the past few weeks trying to figure a way around this problem, and have yet to find a good enough solution. Internet Explorer leaks memory when I update a div container using innerHTML, this does not occur in firefox. This would not be a problem except the webpage is required to be left on for weeks on end without being restarted. I presume the issue with innerHTML is that Internet Explorer apparently parses what you give...
5
3849
by: noddy | last post by:
The full code relating to this question can be found at http://marc.info/?l=php-general&m=112198633625636&w=2 It describes a bare bones way of making an AJAX request. It works fine for me except at the last step where data is put into an innerHTML element within <div id="foo"> </div> Here is the function to do that:
3
1831
by: BeginnerHyun | last post by:
A question on "innerHTML". Hi, The below is my HTML code. ActiveX function "GetData()" returns HTML string which may include javascript codes. This HTML string may be HTML codes in any pages which I will navigate to. The result of the below code is not what I expected. Error occurred in the line "divEncId.innerHTML=enc;".
0
9404
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10009
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8835
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.