HighDots Forums  

Uncaught Exception... I have no clue about.

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Uncaught Exception... I have no clue about. in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
-Lost
 
Posts: n/a

Default Uncaught Exception... I have no clue about. - 12-18-2006 , 09:08 AM






Error: uncaught exception: [Exception... "Component returned failure code: 0x80004001
(NS_ERROR_NOT_IMPLEMENTED) [nsIDOM3Document.domConfig]" nsresult: "0x80004001
(NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame ::
file:///D:/sites/_test/js/iterate_document.htm :: <TOP_LEVEL> :: line 15" data: no]

Line 15 being:

s += j + ". " + i + ": " + document[i] + "<br />\n";

All the code:

s = '';
j = 1;
for (i in document)
{
s += j + ". " + i + ": " + document[i] + "<br />\n";
j++;
}

In Mozilla Firefox it prints a nice 136 item long list, but also throws that error up.
Can anyone explain to me what it means and why it popped up?

Many thanks in advance.

-Lost



Reply With Quote
  #2  
Old   
git
 
Posts: n/a

Default Re: Uncaught Exception... I have no clue about. - 12-28-2006 , 09:02 AM






On Mon, 18 Dec 2006 10:08:57 -0500, -Lost wrote:

Quote:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004001
(NS_ERROR_NOT_IMPLEMENTED) [nsIDOM3Document.domConfig]" nsresult: "0x80004001
(NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame ::
file:///D:/sites/_test/js/iterate_document.htm :: <TOP_LEVEL> :: line 15" data: no]

Line 15 being:

s += j + ". " + i + ": " + document[i] + "<br />\n";

All the code:

s = '';
j = 1;
for (i in document)
{
s += j + ". " + i + ": " + document[i] + "<br />\n";
j++;
}

In Mozilla Firefox it prints a nice 136 item long list, but also throws that error up.
Can anyone explain to me what it means and why it popped up?

Many thanks in advance.

-Lost
Dood,

This issue is caused because you are adding document[i]. This forces the
javascript engine to call the default toString method for each element in
the document. It there is no default toString method for a aparticular
element an error will be thrown. In the case of the MS javascript engine,
that error is 'not implemented'.

Just put a try block around the troublesome statement and make it add some
indicative text like 'unknown' instead if an error is thrown.

Cheers

AJ


--
Cubical Land:
www.cubicalland.com
Nerds-Central:
nerds-central.blogspot.com



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.