forked from aui/artDialog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiframe.html
executable file
·46 lines (45 loc) · 906 Bytes
/
iframe.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>iframe - test</title>
<style>
body {
margin: 0;
}
#doc {
height: 560px;
}
#doc iframe {
display: block;
width: 550px;
border: 1px solid #CCC;
height: 450px;
margin: 100px auto 0 auto;
}
</style>
</head>
<body>
<script>
!/http/.test(location.protocol) && document.write('<h1>请在服务端预览(Chrome 浏览器本地访问 iframe 会跨域无权限)</h1>');
</script>
<div id="doc">
<iframe id="test-iframe" src="about:blank" data-src="show-element.html"></iframe>
</div>
<script src="../lib/sea.js"></script>
<script>
seajs.config({
alias: {
"jquery": "jquery-1.10.2.js"
}
});
</script>
<script>
seajs.use(['jquery', '../src/dialog'], function ($, dialog) {
window.dialog = dialog;
var $iframe = $('#test-iframe');
$iframe.attr('src', $iframe.data('src'));
});
</script>
</body>
</html>