I have a MVC application which I'm trying to display through an iframe.
I get following error message:
This content cannot be displayed in a frame
I've googled some and found that I should use a meta tag. I've used it in my shared layout page in my MVC project but its still not working.
<meta http-equiv="X-Frame-Options" content="allow">
Rendered HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<meta name="viewport" content="width=device-width"/>
<meta http-equiv="X-Frame-Options" content="allow">
</head>
<body>
</body>
</html>
My iframe:
<asp:Content ID="Content1" ContentPlaceHolderID="MainRegion" runat="server">
<div>
<input type="hidden" name="nSystemId" value="<%= strSystemId %>" />
</div>
<iframe src="http://myServer/Project/Controller/" seamless="seamless" frameBorder="0" height="600" width="400"></iframe>
</asp:Content>
Related
This is an example:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<iframe width="200" height="200" src="https://www.dl.dropboxusercontent.com/pages.html/dl=1"></iframe>
</body>
</html>
I want the tag to work as a file
I have the following HTML files
INDEX.HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>This is a frameset with OBJECT in the HEAD</title>
</head>
<frameset cols="50%,50%">
<frame src="bianca.html" name="bianca"></frame>
<frame src="second.html" name="second"></frame>
</frameset>
</html>
BIANCA.HTML
<!-- In bianca.html -->
<html>
<head>
<title>Bianca's page</title>
</head>
<body>
...the beginning of the document...
<p id="test">
<script type="text/javascript">
console.log(window.parent.bianca.document.getElementById("test"));
console.log(window.parent.second.document.getElementById("test1"));
</script>
...the rest of the document...
</p>
</body>
</html>
SECOND.HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h1 id="test1">From second frame</h1>
</body>
</html>
The output(as logged in the console)is :
<p id="test">...</p>
undefined
Why is the second line undefined, however if i change the order of the frames in index.html as:
<FRAME src="second.html" id="second" name="second"></FRAME>
<FRAME src="bianca.html" id="bianca" name="bianca">
then correct output(as expected) is logged. Why is it not working in the first case?
I've been trying other people's examples of how to share a webpage with a video on it to facebook, and hoping that the video can play inline in the facebook wall. So far in each of my attempts, facebook only shows the meta information text of my webpage on the profile feed, but doesn't show a video. Here's my HTML code:
<!DOCTYPE html>
<html xmlns:og="http://ogp.me/ns#">
<head>
<title>Ocean Vid</title>
<meta property="og:type" content="video" />
<meta property="og:video:type" content="video/mp4" />
<meta property="og:video:width" content="500" />
<meta property="og:video:height" content="500" />
<meta property="og:video" content="https://mywebapp.com/video/oceans.mp4" />
<meta property="og:video:secure_url"
content="https://mywebapp.com/video/oceans.mp4" />
</head>
<body>
</body>
</html>
What am I doing wrong?
I got it working. From what I can tell, this is the minimum to get HTML5 video to post on facebook
<!DOCTYPE html>
<html>
<head>
<title>Ocean Video</title>
<meta property="og:image" content="http://vjs.zencdn.net/v/oceans.png" />
<meta property="og:type" content="video" />
<meta property="og:video:type" content="video/mp4" />
<meta property="og:video" content="http://vjs.zencdn.net/v/oceans.mp4" />
<meta property="og:video:secure_url" content="https://mycoolwebsite.com/video/oceans.mp4" />
</head>
<body>
</body>
</html>
In my case, I needed to make sure I had both a thumbnail image and a secure_url for a video.
I am trying to download a webpage (printer web portal) with Watin but all I get is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<HTML lang="en">
<HEAD>
<TITLE></TITLE>
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta content="text/javascript" http-equiv="Content-Script-Type">
<link rel="stylesheet" type="text/css" href="default.css">
<script type="text/javascript" src="init.js"></script>
<noscript>
<meta http-equiv="refresh" content="0; URL=js_error.xml">
</noscript>
</HEAD>
<BODY BGCOLOR="#ffffff" LINK="#000000" ALINK="#ff0000" VLINK="#000000" onload="init();location.replace('./system.xml');">
</BODY>
</HTML>
Even when I go to "View Page Source" in Firefox or IE, I don't get the "full" HTML. However, Firebug shows the full HTML.
Seems that the HTML is loaded by javascript afterwards, but how do I obtain this data?
At chrome, I focus at "A" iframe. There is element setted accesskey attribute on other iframe. I can't use accesskey to focus on the element. This problem doesn't exist at IE,FF.
Is there some trick can solve this problem? my code is below:
index.html:
<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<input type="text" accesskey="b" name="some_name" value="">
<iframe src="a.html"></iframe>
<iframe src="b.html"></iframe>
</body>
a.html:
<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<input type="text" accesskey="e" name="some_name" value="">
</body>
b.html:
<!doctype html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Index</title>
</head>
<body>
<input type="text" accesskey="t" name="some_name" value="">
</body>
The problem will be to do with what context the current focus is looking at. So if the user has not clicked inside the respective iframe then the access key will not work. One way to implement this would be to trigger a javascript keyevent, which forwards the key event into each of the iframes until it has met a corresponding access key attribute.