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

[object error]

P: n/a
Hi!

I have a try/catch statement on my webpage, in which a create som html.
Sometimes this routine fails and the catch writes the error in an alert box.
My problem is that the only
thing the error says is [object error] even though I write all the
attributes in the Error object (name, number, description, message).
How can I inspect further what has gone wrong?

/Hansen
Jul 3 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hansen wrote:
Hi!

I have a try/catch statement on my webpage, in which a create som html.
Sometimes this routine fails and the catch writes the error in an alert box.
My problem is that the only
thing the error says is [object error] even though I write all the
attributes in the Error object (name, number, description, message).
How can I inspect further what has gone wrong?
Use a better browser/debugger. Firefox/Mozilla/Netscape + JavaScript
console tends to be better than IE - though on the odd occasion, IE
might be better.

JavaScript is generally not so complex that where errors might occur can
be reasonably easily detected. Try to create a minimal example that
displays the behaviour and post it here - you might find the solution in
the process.
--
Rob
Jul 3 '06 #2

P: n/a
Use a better browser/debugger. Firefox/Mozilla/Netscape + JavaScript
console tends to be better than IE - though on the odd occasion, IE might
be better.
It's a IE only application
JavaScript is generally not so complex that where errors might occur can
be reasonably easily detected. Try to create a minimal example that
displays the behaviour and post it here - you might find the solution in
the process.
It is some very complex code. Showing just a small example wouldn't add to
the solution. But I have found out that inserting a small delay (by using
setTimeout) of 10 miliseconds, cures the problem. I'm just very currious to
find out what caused the problem in the first place, since I don't like
"wait a while" solutions. By using IE and VS 2003 I found out that the error
where caused by the following line:

// for inserting elements
function INTRINSICS_onclick(strHtml, id)
{
var element = editorFrame.DOM.getElementById(id); <-- Halts here
.....
The editorFrame object is a DHTML editor activeX component from MS which is
a part of IE. When the error occours the DOM doesn't contain the id, but I
don't see how this should cause an error since element should just become
null.

Could it be, that the editorFrame object hasn't been created yet or somehow
is unaccessible? But wouldn't that cause a "editorFrame is null or not an
object" error?

/Hansen
Jul 3 '06 #3

P: n/a
Hansen wrote:
>Use a better browser/debugger. Firefox/Mozilla/Netscape + JavaScript
console tends to be better than IE - though on the odd occasion, IE
might be better.

It's a IE only application
>JavaScript is generally not so complex that where errors might occur
can be reasonably easily detected. Try to create a minimal example
that displays the behaviour and post it here - you might find the
solution in the process.

It is some very complex code. Showing just a small example wouldn't
add to the solution. But I have found out that inserting a small
delay (by using setTimeout) of 10 miliseconds, cures the problem. I'm
just very currious to find out what caused the problem in the first
place, since I don't like "wait a while" solutions. By using IE and
VS 2003 I found out that the error where caused by the following line:

// for inserting elements
function INTRINSICS_onclick(strHtml, id)
{
var element = editorFrame.DOM.getElementById(id); <-- Halts
here .....
The editorFrame object is a DHTML editor activeX component from MS
which is a part of IE. When the error occours the DOM doesn't contain
the id, but I don't see how this should cause an error since element
should just become null.

Could it be, that the editorFrame object hasn't been created yet or
somehow is unaccessible? But wouldn't that cause a "editorFrame is
null or not an object" error?
No
the <objectelement *is* loaded, so it isn't null or not an...

But the code loaded _by_ <objectisn't necessarily loaded yet
take a look at the object's readyState attribute...

--
Dag.

Jul 3 '06 #4

P: n/a
But the code loaded _by_ <objectisn't necessarily loaded yet
take a look at the object's readyState attribute...
Even though the readyState is 4 (object is ready) I still get the error.
Seems as if I have to stick with the "wait-hack".

Thanks for the help

/Hansen
Jul 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.