...

View Full Version : Error: Invalid Argument in IE7



chump2877
12-12-2006, 02:01 AM
I'm getting this error on the following page: http://www.mediamogulsweb.com/client/parseXML/testingHTML.html


Error: Invalid Argument

Only in IE7 so far...it works in Mozilla, with no errors...

The error occurs when you click on a trash can, and say "Yes" (I want to delete the chosen record)...(Also, it's OK if you delete a record -- I haven;t coded the deleting part yet, so nothing will happen)...

The error is preventing the "Working" div from loading....what is happening here?

Thanks.

A1ien51
12-12-2006, 02:36 AM
It has an issue with

workingBox.style.top


Eric

chump2877
12-12-2006, 12:43 PM
the problem appears to have been the argument I was using to detect browser, and the order in which I was detecting the browser:

this works:


if (window.ActiveXObject)
document.getElementById('workingBox').style.top = document.body.scrollTop + 145 + 'px';
else
document.getElementById('workingBox').style.top = window.pageYOffset + 145 + 'px';

this doesn;t work:


if (window.XMLHttpRequest)
document.getElementById('workingBox').style.top = window.pageYOffset + 145 + 'px';
else
document.getElementById('workingBox').style.top = document.body.scrollTop + 145 + 'px';

A1ien51
12-12-2006, 12:53 PM
Can I ask why are you not checking to see if the page.. and scroll.. are supported instead of some other unrelated property?

It is sort of checking that it is a fruit when it can be an apple, grape, orange, etc.

Eric

chump2877
12-12-2006, 01:09 PM
Good point...:)


if (window.pageYOffset)
document.getElementById('workingBox').style.top = window.pageYOffset + 145 + 'px';
else
document.getElementById('workingBox').style.top = document.body.scrollTop + 145 + 'px';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum