View Full Version : Debugging [Error Object] in try/catch statement

10-30-2006, 11:09 AM
Hi there,
I'm using ajax to send and receive data, and use cross-domain scripting, this works fine when you add the domain to your IE security settings/Intranet sites list, I want to be able to catch the message IE would normally give you: "This page is accessing information that is not under its control. This poses a security risk... etc... ", and display the message at a different time with a list of other things, I claim myself that I have a brain but cannot figure out for the life of me the properties on the error object caught in the catch statement, example:

xmlHttpReq.open("POST", sURL, false);
alert("error.toString(): " + e.toString());
alert("error.id: " + e.id);

The .asString() returns [Object Error] which is great, but I cannot find any of the properties which give info about the actual error, I've tried .description/.message, the documentation I've found doesn't seem to help, am I viewing an IE error object or an object setup by the previous command e.g. xmlHttpReq.open ?

Thanks for help

10-30-2006, 12:44 PM
Do this:

for(prop in e){
alert(e + ": " + e[prop]);