Long time ago, I sometimes faced similar issue with the style object in IE (quite often really)
You should be able to work around it with one of the following:
- use a js framework such as jQuery (highly recommendable)
- always test object.style.prop before reading or assigning:
if (object.style && object.style.prop) object.style.prop = value;
value = object.style ? (object.style.prop || null) : null;
>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?
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/Never explain, never complain (Queen Elizabeth II)