Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot drop IFRAME content into DIV
Message
 
 
To
25/08/2009 17:26:54
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
01420609
Message ID:
01420611
Views:
26
What is the exact text of JavaScript error?

>I have this simple javascript:
>
>
>function DisplayExternal()
>{
>    lcDiv = document.getElementById("display")
>    lcIFrame = window.frames["buffer"].document.body.innerHTML
>    alert("Start")
>    alert(lcIFrame)
>    alert(lcDiv.innerHTML)
>    lcDiv.innerHTML = "1"
>    alert(lcDiv.innerHTML)
>    lcDiv.innerHTML = lcIFrame
>    alert(lcDiv.innerHTML)
>}
>
>
>The goal is to drop the IFRAME content into a DIV. The first alert shows "Start". Then, it shows the content of the IFRAME. The 3rd alert shows an empty message box as the DIV doesn't content anything yet. Then, I put "1" in it. So, the next display shows "1". So, all this shows that I have some content in the IFRAME and that I can initialize the DIV content. However, before the last line, I am trying to initialize the DIV content with the lcIFrame variable, which we know its content as the alert is showing it. However, that line cannot be executed. It gives a javascript error. I just cannot understand why I cannot assign lcIFrame to the DIV as is.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform