阅读背景:

javascript权威指南第16章HTML5脚本编程

来源:互联网 
<!DOCTYPE html>
<html>

<head>
    <script type="text/javascript" src="HTML5Script.js"></script>
    <script type="text/javascript" src="EventUtilExt.js"></script>
</head>

<body>
    <iframe src="htt://www.wrox.com" id="myframe" width="400" height="300"></iframe>
    <div aria-busy="true" style="width:600px;height:300px;background-color:honeydew;" draggable="true">
        <img src="timg.gif" id="droptarget" draggable="true">
    </div>
    <div>
        <video src="conference.mpg" id="myVideo">Video player not available.</video>
        <!-- 嵌入视频 -->
        <video id="myvideo">
            <source src="conference.webm" type="video/webm;codecs="vp8" vorbis"">
            <source src="conference.ogv" type="video/ogg;codecs="theora" vorbis"">
            <source src="conference.mpg">
            Video player not available.
        </video>
        <!-- 嵌入音频 -->
        <video >
            <source src="song.ogg" type="audio/ogg" >
            <source src="song.mp3" type="audio/mpeg" >
             Video player not available.
        </video>

    </div>
    <script type="text/javascript">

        EventUtilExt.addHandler(window, "message", function (event) {
            //确保发送资讯的域是已知域
            if (event.origin == "https://www.wrox.com") {
                //处置吸收到的数据
                processMessage(event.data);
                //可选:向起源窗口发送回执
                event.source.postMessage("Received", "https://p2p.wrox.com");
            }
        });

        var iframewindow = document.getElementById("myframe").contentWindow;

        iframewindow.postMessage("A secret", "https://www.wrox.com");

    </script>
</body>

</html>
<!DOCTYPE html>
<html>

<head>
    <script type



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: