Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
63 lines (62 sloc) 1.81 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">
<style>
body {
padding: 10px;
}
h1 {
font-family: Georgia;
font-size: 123.1%;
font-weight: bold;
}
h2 {
font-family: Georgia;
font-weight: bold;
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>Domain: josephjiang.com</h1>
<a href="http://josephjiang.com/project/yui3-crossframe/iframe.html">Reload Page</a>
<h2>Data Received:</h2>
<div id="data" class="loading"></div>
</div>
<script type="text/javascript" src="yui-debug-fix.js"></script>
<script type="text/javascript" src="crossframe.js"></script>
<script type="text/javascript">
YUI().use("json-parse", "crossframe", function (Y) {
Y.Global.on("crossframe:message", function (e, o) {
var data = Y.JSON.parse(o.message);
var html = ["<ul>"];
for (var i in data) {
html.push("<li>" + i + " = " + data[i] + "</li>");
}
html.push("</ul>");
document.getElementById("data").innerHTML = html.join("");
Y.one("#data").removeClass("loading");
});
});
</script>
</body>
</html>