Loading whole web-page - html

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.

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.

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?

Related

Auto refresh in Mac not working for some site

I got a code that refreshes the html page as per the seconds I desire. I am on an Mac and I use the TextEdit app to make the HTML file. This code works for www.apple.com but it does not work for say, https://www.bitcointalk.org or http://www.macrumors.com.
I am not sure why this is happening. All I am doing is replacing the apple URL with bitcointalk url. I know I can also do this refreshing via Safari extension, but I need this code to work.
Thanks a lot
The code I am using is:
<html>
<head>
<meta http-equiv="refresh" content="5">
</head>
<FRAMESET>
<FRAME src="http://www.apple.com/">;
</FRAMESET>
</html>
EDIT: What I am trying to do is, create this html and move it to my iPhone, so that I can do the web refresh through my phone. Right now there are only paid apps in the App store that lets you refresh a page automatically every few seconds/minute and they are not really that good.
As #esqew pointed out in their comment, the sites that aren't showing up forbid access via frames by setting the X-Frame-Options HTTP header to DENY or SAMEORIGIN.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options

Website fails to load, but on refresh loads?

So my domain is pointed at a redirect file which in turn loads the first page in a website.
It has worked in the past. The host recently switched servers though and said it would be seamless. Now when you navigate to www.AiySlumlords.com it hits the redirect then fails to load the second page. HOWEVER, if you hit refresh after it fails then it loads?
I have no clue why this isn't working. Here is the redirect file
<html>
<head>
<title>A web page that points a browser to a different page after 2 seconds</title>
<meta http-equiv="refresh" content="0; URL=./Home/f1.html">
<meta name="keywords" content="automatic redirection">
</head>
<body>
<p>If your browser doesn't automatically go there within a few seconds, you may want to go to the destination manually.</p>
</body>
</html>
Since your server is powered by IIS and ASP.NET, it's better to use ASP.NET to redirect your client, e.g. create an index.aspx page with the following content:
<%
Response.Redirect("~/Home/f1.html", false);
Response.StatusCode = (int)System.Net.HttpStatusCode.MovedPermanently;
Response.End();
%>

Access anchor tag attribute inside iframe

Parent domain: www.parent.com
Iframe domain: www.iframe.com
<html>
<head></head>
<body>
<iframe id="trick" src="www.iframe.com/test">
<html>
<head></head>
<body>
test
</body>
</html>
</body>
</html>
Question: how to access the value of href of anchor tag inside iframe using jquery?
Since they pages appear on different origins:
The page containing the frame needs to listen for a Message event.
The page inside the frame needs to send a message using postMessage.
This, obviously, requires changes on both sites. Explicit co-operation between the sites is required for obvious security reasons (if they aren't obvious, imagine your bank's website being loaded in an iframe by a random site you visited via Google).
Check this link: http://simple.procoding.net/2008/03/21/how-to-access-iframe-in-jquery/
$('#iframeID').contents().find('#someID').html();

Trouble using chrome frame

I detect if a user has chrome frame by placing this in teh body of my page:
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"> </script>
<div id="placeholder"></div>
<script>
CFInstall.check({
node: "placeholder",
destination: "http://www.waikiki.com"
});
</script>
In the header of my boilerplate page I have:
<meta http-equiv="X-UA-Compatible" content="chrome=1">
I managed to get the site to prompt me to install chrome frame, which I did, but the page still renders with IE errors, any ideas why?
Using IE7.
You can tell if the page is using chrome frame by right clicking on the page. If the context menu lists "About Chrome Frame.." it's rendering the page via chrome frame plugin.
Also you need to call CFInstall.check after the body is loaded.

Get Frame src URL in address bar

I'm working on making a mobile version of a website hosted on a GoDaddy Windows server. The way GoDaddy apparently handles a mobile subdomain is by having that webpage be inside a frame. For example:
<head>
</head>
<frameset rows="100%,*" border="0">
<frame src="myurl.com" frameborder="0" />
<frame frameborder="0" noresize />
</frameset>
<!-- pageok -->
<!-- 02 -->
<!-- -->
</html>
The problem is that any link I open in that page opens within the frame and the URL in the address bar never changes. So my question is how can I get the frame URL to show in the browser's address bar. As far as I know, GoDaddy doesn't give me access to the file with the above html in it to allow me to alter that. Each page has an initial php script ran to check if it needs to redirect to a mobile browser, so if there is a way to do this with PHP, I can easily implement it.
Thanks for any help you guys can offer.
You can accomplish this using JavaScript on your page:
top.location.href = document.location.href;
This effectively "breaks" out of the parent frame by setting the parent frame window location to the location of the current frame.
Of course, you'd want to have some sort of indicator that you just broke out of the frame as to prevent looping:
if (
(document.location.href.indexOf("#ibrokeout") == -1) &&
(top.location != location)
) {
// Break out of the frame
top.location.href = document.location.href + "#ibrokeout";
}
Hope this helps.