IE10 iFrame loads page but doesn't display - html

I am trying to set up an iFrame to show a form from another domain within our company. And testing it in Chrome or Firefox works just fine.
The problem is, for IE 10, instead of showing the form, the browser is instead showing a blank page in the iFrame.
I've broken it down to a very simple test.html on my desktop. The Developer's Tools show that the network call not only works - but it registers loading files that are being included in the page I'm trying to call. I've even seen the debug statements in the form's javascript firing, and ajax calls running. But the iFrame is still showing blank.
I have hunted and searched and cannot figure out how to make this work.
The calling page has:
<!doctype html>
...
<DIV><iframe height="400" width="100%" src="http://my.domain.com/myForm?userName=clicky&email=cMcTesterton#domain.com"></iframe></DIV>
The called page has as its first two lines:
<%# page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!doctype html>
Which, of course, changes to simply
<!doctype html>
I am using URL binding, so there isn't an extension to speak of.
I have gone into IE's Internet Options -> Security -> Custom level ... -> miscellaneous to enable Launching Programs and files in an IFRAME and Navigate windows and frames across different domains
I can't even figure out what else to look for. It especially confuses me that according to the console, it has to be reading the page I'm trying to bring up. It just isn't showing it.

You have to configure, either (1) your site http://my.domain.com or (2) the page located in the site http://my.domain.com to send out the X-Frame-Options meta tag.
The X-Frame-Options meta tag is basically a hint to tell the browser that it's safe to render the page inside an iframe.
Option 1 - configure your webserver to send out the X-Frame-Options meta tag
<system.webServer>
...
<httpProtocol>
<customHeaders>
<add name="X-Frame-Options" value="ALLOW-FROM http://my.otherdomain.com" />
</customHeaders>
</httpProtocol>
...
</system.webServer>
Option 2 - configure your page (the one referenced at src="http://my.domain.com/myForm?userName=clicky&email=cMcTesterton#domain.com") to send out the X-Frame-Options meta tag
<head>
<meta name="X-Frame-Options" content="ALLOW-FROM http://my.otherdomain.com">
....
</head>
Source

Related

Removing header <frameset> in redirected sites

I am facing an issue with mobile version of my site. The site is hosted on a different domain.
I Tracked down the issue and saw that its being caused by the being wrapped on top of my actual html code.
Here is a snippet:
<html>
<head>
<title>Where are you</title>
<meta name="robots" content="noindex, nofollow">
<meta name="description" content="Let’s your friends and family know about your where about.">
<meta name="keywords" content="Stay connected, Plan meetup, Unreachable friend, Share location, Share photos">
</head>
<frameset rows="100%">
<frameset cols="100%">
<frame src="http://wru.buttur.com" frameborder="0">
#document
</frameset>
</frameset>
</html>
My website is getting loaded inside "#document".
Can i do some configuration on my domain to prevent this from happening.
I know this is old, but I am responding because we had a similar problem where some outside entity managed a website, and we took over after it became broken.
It was a wordpress site and everything was being wrapped inside a frameset. We were baffled by the fact that direct browser requests to hosted javascript files would work fine, but within the page it would become wrapped in frames in the network response.
Even direct jQuery.getScript() calls from external sites would exhibit the scenario. Again, worked fine if typed into browser url bar.
Turns out there's something called DNS frame forwarding.
Here's a topic that covers the scenario:
https://stackoverflow.com/questions/7083391/godaddy-dns-forward-to-ip-adds-frames-to-html
Edit:
Looks like a moderator removed that post. How strange!! Too bad as well, that post had exactly the right answer with exactly the right description.
Well basically anyone coming across this, just research DNS frame forwarding. You'll find your answer there.
Terms for google:
website wrapped in frameset
javascript responds in frame
css in frame
Resource interpreted as Stylesheet but transferred with MIME type text/html
Uncaught SyntaxError: Unexpected token <

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

asp net mvc login page doesn't work inside iframe

I am working on a feature where our site is able to load another mvc site.
Basically I am using a Iframe with Id=aquaVetIframe where I put the url for my mvc site(setup of the src attribute for the iframe is done from codebehind). Everything is working fine in chrome. but at moment to test it using IE 10 the only thing what i can see in IE is the login page.
After sign in with the user the page return to the same login page. I could suppose that is related with the caching but i am not 100% sure.
here some code:
My aspx container:
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<meta http-equiv="Cache-Control" content="max-age=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<style type="text/css">
html, body{height: 100%;}
</style>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="MainContent" runat="server">
<div style="height: 100%; width: 100%;">
<iframe id="aquaVetIframe" runat="server" allowfullscreen="true" style="position: absolute;height: 100%; width: 100%;border:0px"> </iframe>
</div>
</asp:Content>
Code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim urlQueryString = Request.QueryString("urlId")
aquaVetIframe.Attributes("src") = urlQueryString
End Sub
At the top of my page I tried add the next tags, but with no luck:
<meta http-equiv="Cache-Control" content="max-age=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
Here an image of the http post requests using IE10 and chrome (browser where currently is working my app)
http://postimg.org/image/iaifcljdz/
UPDATE:
Adding this line to my mvc application, cookies are allowed from IE and the application run fine while I executing the page directly in the browser (right click on run on IE browser in VS2013)
context.BeginRequest += (sender, args) => HttpContext.Current.Response.AddHeader("p3p", "CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
The issue what i have now is that my mvc aplication is not executing when I run my application from the begining.. for some strange reason the js libraries from mvc app are not loading..
see screenshot
Three things at a first look:
1) the iframe loads a full html page. So I recommend you to import the jquery libs inside the page you loaded inside the iframe (the login page);
2) IE is a good source of problem when testing a localhost server. It sometimes force a compatibility to IE8 or even IE7 on intranet (that includes localhost) pages. Ensure you have the IE10+ mode enabled. This question shows you how to do it:
You can achieve it by adding the following tag to your page
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
</head>
OR you can also add the following code in your web.config, inside the system.webserver tag (create it if it doesn't exist):
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=Edge" />
</customHeaders>
</httpProtocol>
</system.webServer>
3) As you didn't show your tags including the JS files, then It's a good idea to take a look at them (including the jquery ones). Ensure:
You are opening and closing <script></script> tags correctly. NEVER USE THE SHORT FORM <script /> when including a JS file because it won't work;
Make sure you are using the correct path. Using a relative path (like ~/scripts/jquery.js) doesn't work because of '~'. You can also find some trouble if you are using a subfolder for your site's root, like http://localhost/mysite/. In this case, your includes should include the folder /mysite or use relative paths (like scripts/jquery.js, ../scritps/jquery.js, etc).
Maybe this is isn't enought, but is a first needed step to get closer to a working code.
Go to IE > interntet options > security > custom level > Scroll down Misc > find "Launching programs and files in an Iframe" > enable
Consecutive ajax call with no change in request are often considered as cached by some browsers and this issue is particularly reproducible in IE 10. The response for request is HTTP 304 Not Modified and request doesn't hit the database. The solution is to use ajaxSetup to set cache to false like :
$(document).ready(function() {
$.ajaxSetup({ cache: false });
});
NOTE: This will set cache false for all ajax calls in the session.
OR
Using cache: false in particular ajax calls, if you don't want to disable cache for all ajax calls.
$.ajax({
...
cache: false,
...
});
For non-ajax call you can use :
Response.Cache.SetExpires(DateTime.Now.AddSeconds(0));
to response for suspected cached calls.
Also, it may be seems odd but I also faced similar issue in IE but that was due to cookie. Somehow there were two different cookies are created with same name & thus values stored in cookie wasn't found thus user was stuck on login page. Check if COOKIE is also not culprit in your case too.

VS2012: Page inspector and view in browser won't work

I am new to website development, and I am having trouble viewing my webpage in a browser.
When I try to open the webpage in page inspector/ choose "view in browser" I get the following error.
Page Inspector:
"The attached page is not running in a compatible Internet Explorer standards mode. To use the latest document mode add the following meta tag to the html page: To try to dynamically add the meta tag for this session click here."
View in Browser:
"Uh-oh, something went wrong! Error Code: 500"
I've tried adding the meta tag to the source HTML and it still doesn't work. Also, I am following step-by-step tutorials on youtube, doing everything exactly the same, yet it still won't work. If I open a ASP.Net webforms site I can view it in the browser, I'm just having trouble viewing them when I start from an empty website form.
Here is the header of my html code.
**<%# Page Language="C#" AutoEventWireup="true" CodeFile="Registration.aspx.cs" Inherits="Registration" %> <!DOCTYPE html> <html xmlns="w3.org/1999/xhtml">; <head runat="server"><title></title> <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>**
any help would be greatly appreciated.
I think there are something wrong in the IIS.
First, please check which IIS that the project used and check whether the ASP.NET Application Development Feature has installed. (Right click the project=>Properties=>Web)
If it used the default IIS Express please try to re-install the VS and try again. You could try to host it to local IIS and check the result.
Or
(Right click the project=>Property Window => Managed Pipleline Mode > Classic

VS2012: Page inspector/"view in browser" won't work

I am new to website development, and I am having trouble viewing my webpage in a browser.
When I try to open the webpage in page inspector/ choose "view in browser" I get the following error.
Page Inspector:
"The attached page is not running in a compatible Internet Explorer standards mode.
To use the latest document mode add the following meta tag to the html page: <meta http-equiv="X-UA-Compatible" content="IE=Edge" >
To try to dynamically add the meta tag for this session click here."
View in Browser:
"Uh-oh, something went wrong! Error Code: 500"
I've tried adding the meta tag to the source HTML and it still doesn't work. Also, I am following step-by-step tutorials on youtube, doing everything exactly the same, yet it still won't work. If I open a ASP.Net webforms site I can view it in the browser, I'm just having trouble viewing them when I start from an empty website form.
Hope this makes sense and thank you.