简体   繁体   中英

Iframe on mozilla popup issue

I have a problem with popups when I call iframe.

Here is a picture:

Mozilla弹出窗口的图片

I don't want to get this popup.

This is my script:

function readfile() { 
alert(document.getElementById('iframe').contentDocument.body.firstChild.innerHTML);

This is the call from text link:

<li><a href="e90_data/sasija/prazno.txt" style="text-decoration: none" target="iframe_a">Prazno</a></li>

This is the iframe on the end of the page:

<iframe id='iframe' name="iframe_a" src = 'demo_iframe.htm' est.align="top" width=900px height=550px > <p>Vas browser ne podrzava IFRAME!.</p> </iframe>

On Chrome it appears normally, without a popup.

From MDN

From the DOM iframe element, scripts can get access to the window object of the included HTML page via the contentWindow property. The contentDocument property refers to the document element inside the iframe (this is equivalent to contentWindow.document), but is not supported by Internet Explorer versions before IE8.

I think you want to be using contentWindow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM