1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4 <meta name="viewport" content="initial-scale=1" />
7 function accessParentElement() {
8 window.opener.document.body.style.backgroundColor = "#BBFFFF";
10 function accessWebMessaging() {
11 window.opener.postMessage ("web messaging!<br>", "*");
14 // create custom event
15 var event = new CustomEvent("pdevent", {
17 message: "custom event!<br>",
23 function accessCustomEvent() {
24 window.opener.dispatchEvent(event);
28 <body bgcolor="#FF9966" text="#FFFFFF">
29 This is a PD.<br>A PD can control the Box.<br>
30 <input type="button" value="ColorChange" onclick="accessParentElement()" />
31 <input type="button" value="WebMessage" onclick="accessWebMessaging()" />
32 <input type="button" value="CustomEvent" onclick="accessCustomEvent()" />
33 <div id="fromBox"></div>