Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

60 lines (59 sloc) 1.85 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="zh-tw">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Cross Frame Prototype</title>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssreset/reset-min.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssfonts/fonts-min.css">
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssbase/base-min.css">
<script type="text/javascript" src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script>
<style>
body {
padding: 10px;
}
h1 {
font-family: Georgia;
}
h2 {
font-family: Georgia;
margin: 10px 0;
}
#data {
height: 300px;
border: dotted 1px #ccc;
}
.loading {
background: url(http://devm1-muchiii.dlink.com.tw/miiicasa/bg_loading.gif) center center no-repeat;
}
ul {
}
ul li {
margin-left: 25px;
list-style-type: decimal;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div id="foo">
<h1>window.frames["opener-iframe"]</h1>
<a href="http://josephjiang.com/project/yui3-crossframe/opener-iframe.html">http://josephjiang.com/project/yui3-crossframe/opener-iframe.html</a>
<h2>Data Received:</h2>
<div id="data"></div>
</div>
<script type="text/javascript">
window.onload = function () {
try {
// 想不出一個好名字... targetHandler ?
window.opener.targetHandler = function (content) {
document.getElementById("data").innerHTML = content;
// 確認訊息
window.opener.sourceHandler("success from " + location.href);
};
} catch(e) {
alert(e.message);
}
};
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.