I using parent window and one iframe my html code is given below
Page1.html
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<a name="logo" href="Page2.html">dsd</a><br/>
ttttttbr/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
<iframe name="I1" src="Page3.html">Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
</body>
</html>
Page3.html
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
dsd<br/>
</body>
</html>
If i click the link in side iframe, open the page2.html in side iframe and move to the top of the page of parent window together.
How i can do this ?
hoping ur support
Alex
I think this can't be done using pure HTML. You would need JavaScript for that, something like this:
<a href="Page2.html" onclick="parent.location.href='#'">
Related
I have an embed tag inside my html page with src as some external URL (same origin).
This embed tag populates some content inside my (parent)html page.
From my parent html page (top window) I am not able to access contentWindow of tag.
The content of <embed> tag is not media, instead its html content.
A similar question was asked here but question did not get relevant response.
Note : please don't suggest me to use a iframe or object tag
Snippet :
<!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>Embed content</title>
</head>
<body style="margin-bottom: 3rem;">
<h1>Embed tag testing</h1>
<div style="border: 1px solid maroon;width: 803px;">
<embed id="custom-embed" src="validation.html" height="500px" width="800px">
</div>
</body>
</html>
I have a new project where I should implement a new application in an existing system. Users will be able to access my app through an existing login page. Once they log in I will have all information available in my session variables. Link for my app is available for the users based on their credentials. Now I want to organize my home page. My question is should I use iframe to be my home page? Should I place everything else inside of the iframe? I don't have experience working with iframes and I'm not sure if this is the best option. Here is example of what I have:
<iframe src="Home.cfm" name="homeFrame" id="homeframe" frameborder="0" scrolling="no"></iframe>
Here is my Home.cfm page:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=10; IE=11" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home Page</title>
<script src="JQuery/jquery-3.2.1.min.js"></script>
</head>
<body>
<div class="mainpage">
</div>
</body>
</html>
Also i have included JQuery on my home page. I might have two more pages in this app. Is that the best place to include the library? Or that should be included on each page in the app?
If you add it in home page that is enough.Try like below:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=10; IE=11" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Home Page</title>
<script src="JQuery/jquery-3.2.1.min.js"></script>
<script src="default.js"></script>
</head>
<body>
<div class="mainpage">
//whatever you have already in this page.Using iframe you can display a separate document, including scrollbars and borders.
<iframe src="Home.cfm" name="homeFrame" id="homeframe" frameborder="0" scrolling="no"></iframe>
</div>
</body>
</html>
default.js:
$(function(){
alert('success');
//your stuff
});
I created simple html page with meta tags to share some image,texts and url on facebook.I hosted this file and saw that link in Open Graph Object Debugger.but it only get images and descriptions of raw tags in my og:url property.it didnt show og:image,og:description property in my page.I want to add url,different image and description.how add meta tag to do that?
<!DOCTYPE html>
<html>
<head>
<meta property="og:url" content="http://www.google.com" />
<meta property="og:description" content="some text" />
<meta property="og:image" content="http://example.com/images/image1.jpg" />
<meta property="og:title" content="title" />
</head>
<body>
<h1>HELLO WORLD</h1>
</body>
</html>
I have an index.html and edit.html and trying to do the following, but by clicking the second and third link, the emulator showed me an error saying: Application Error, A network error occurred (file://android_asset/www/edit.html?id=2) and (file://android_asset/www/edit.html?id=3)
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=no" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<link rel="stylesheet" href="master.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="cordova-1.8.0.js"></script>
<script type="text/javascript" charset="utf-8" src="main.js"></script>
</head>
<body id="stage" class="theme">
<h1>Welcome to XXX!</h1>
1
2
3
</body>
</html>
my edit.html is just a html header and body.
Any idea why?
Yes, this is a bug in Android not PhoneGap. Go star this Google issue to add your voice:
http://code.google.com/p/android/issues/detail?id=17535
In other news we believe we will have a work around in the 1.9.0 release which will be out at the end of the month.
I have a page that has a cross-domain iframe. On the page loaded in the iframe is a print button that runs some javascript to print an iframe named printFrame sitting on the page (on the nested page, not on the parent page). When I click on the button, in FF it works but IE gives me an error: frames.printFrame is null or not an object. I'm confused. The code is not trying to access the parent document, why isn't it working?
The code crashes on line 9 of iframedoc.html, when I try to access the printframe
Parent document HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<iframe src="http://www.otherdomain.com/iframeDoc.html"/>
</body>
</html>
iframedoc.html:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
function printContent(){
frames['printFrame'].focus();
var printFrameDiv = frames['printFrame'].document.getElementById("printDiv");
printFrameDiv.innerHTML = document.getElementById('printableContent').innerHTML;
frames['printFrame'].print();
window.focus();
}
</script>
</head>
<body>
<iframe id="printFrame" name="printFrame" src="/printFrame.html"></iframe>
<div id="mainContent">
<div id="printableContent">
My printable content is here
</div>
<div id="nonPrintableContent">
Content that I dont want to print is here
</div>
Print
</body>
</html>