Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Invalid argument appears only in IE
Message
From
17/01/2013 22:38:21
 
 
To
All
General information
Forum:
Javascript
Category:
Troubleshooting
Title:
Invalid argument appears only in IE
Miscellaneous
Thread ID:
01563215
Message ID:
01563215
Views:
74
IE gives me a problem with an application. It only happens in that browser. This is version 9. Some others reported the problem on other version. I have read on the net that IE gives a lot of those Invalid argument noted as one of the worst browser that ever existed. Ok, so this is some feedback I read. But, that doesn't help in resolving the issue.

The situation is that I have the application running for hours or days where a few lines will dump the content of the IFrame into a DIV. So, the IFrame only serves for loading the content. Then, I use a DIV to show the content on top of my main page, such as Facebook is doing for the photo slideshow.

So, this runs ok for a long time and suddently, it gives:

"Message: Invalid argument."

This is the only code I have in that page:
if (window.parent.loDiv)
{
   window.parent.document.body.removeChild(window.parent.loDiv)
}
window.parent.loDiv=window.parent.document.createElement("div")
loDiv=window.parent.loDiv
window.parent.document.body.appendChild(window.parent.loDiv)

IFrameInitialization()

function IFrameInitialization()
{
   loDiv.style.position='absolute'
   loDiv.style.left='0px'
   loDiv.style.top='0px'
   loDiv.style.width="100%"
   loDiv.style.height=window.parent.document.body.scrollHeight+"px"
   loDiv.style.background="url(Images/DivFade.png)"
   loDiv.style.visibility="hidden"
   loDiv.innerHTML=" "+document.body.innerHTML
   loDiv.style.visibility="visible"
   loDiv.focus()
}

function CloseWindow()
{
}
This page mentions that this may happens when we try to set an invalid value when using the style:

http://stackoverflow.com/questions/1008290/invalid-argument-error-in-ie-in-a-line-number-that-doesnt-exist

In my code, I have this on the 6th line of the IFrameInitialization() function where I try to set loDiv.style.height.

So, it seems, that after a while, IE looses contact with window.parent, or window.parent.document, or window.parent.document.body.

Anyone would have any feedback on this?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform