user2301515
user2301515

Reputation: 5107

Loading whole web-page

I try to load a concrete web page with iframe:

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <iframe id="frame" src="http://www.euronics.ee/" frameBorder="0" width="1000px" height="700px"></iframe>
    </body>
</html>

Why it cannot load whole page. It loads only body? It loads another pages well if i try.

Upvotes: 0

Views: 252

Answers (2)

Barbara Laird
Barbara Laird

Reputation: 12717

When I try it in jsfiddle, I get the following console error: Blocked a frame with origin "http://www.euronics.ee" from accessing a frame with origin "http://fiddle.jshell.net". Protocols, domains, and ports must match. Could it be that the site you're loading has https requests?

Upvotes: 0

Ms. Nobody
Ms. Nobody

Reputation: 1219

If you check that sites code, you will see:

<script type="text/javascript">
            //This block of javascript checks if the current page is opened in a popup IFrame
            //and if this is true - closes popup and reloads parent window.
            //We use Popup template for popup windows and only this template is accepted for popups. A window with any other template will be closed immidiately.
            //This also solves the problem with redirecting to parent after user has logged in via Login popup. After loggin in user is redirected back to My Account page
            //which in turn uses Audio template thus immidiately gets closed and parent gets reloaded.
            if (self != top) {
                $("body").empty(); //also clears body to avoid showing page content while the page is closing
                parent.location.reload();
            }
 </script>

And that's why it won't load the site in your iframe I guess. Not everyone likes the idea of their site to be shown on other sites in iframes. I would say that they just want real visitors.

Upvotes: 5

Related Questions