Reputation: 8463
How can i solve object error in ie7. Once i load my page. ie7 shows [object Error]
in an alert box. i want to know why it happens and how to solve this.
Upvotes: 0
Views: 3660
Reputation: 868
(EDIT) this just in:
It now seems that IE7 sometimes displays this popup when an error occurs. It almost looks like it's trying to display an alert()
with an object in it, called error
. Here's how I found out. I was trying to set a table row's CSS display
attribute to table-row
, but after some debugging and internet seaching, I found out that IE7 and earlier do not support table-row
as a display
value. What I had:
document.getElementById('writeoff_tablerow').style.display = 'table-row';
What solved the problem:
try {
document.getElementById('writeoff_tablerow').style.display = 'table-row';
}
catch(e) {
document.getElementById('writeoff_tablerow').style.display = 'block';
}
(EARLIER ANSWER)
I've been stumped with this same thing today. Ultimately, the cause of the problem boiled down to the fact that I was using document.body.addEventListener to make the page respond to a mouse click:
document.body.addEventListener('click',function(){document.getElementById('blah_div_id').style.display='none';},false);
When I changed the code to the following, the problem was gone in IE7:
document.body.onclick=function(){document.getElementById('blah_div_id').style.display='none';};
Upvotes: 1
Reputation: 8463
Since i am using Protovis Graph library. This is cause for my error. Since Protovis is not compactable with ie7 it araise object error.
Upvotes: 0
Reputation: 4688
post some code, otherwise we cant help you.
try the website in Firefox with Firebug installed, and maybe you will get additional information in the console there (if the problem is in FF as well, that is)
Upvotes: 0