html5/spec Overview.html,1.1064,1.1065

Update of /sources/public/html5/spec
In directory hutz:/tmp/cvs-serv29284

Modified Files:
	Overview.html 
Log Message:
Correct example for postMessage(). (credit: avk) (whatwg r1876)

Index: Overview.html
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1064
retrieving revision 1.1065
diff -u -d -r1.1064 -r1.1065
--- Overview.html	15 Jul 2008 10:40:36 -0000	1.1064
+++ Overview.html	15 Jul 2008 10:45:45 -0000	1.1065
@@ -42290,20 +42290,22 @@
 
   <div class=example>
    <p>For example, if document A contains an <code><a
-    href="#object">object</a></code> element that contains document B, and
+    href="#iframe">iframe</a></code> element that contains document B, and
     script in document A calls <code title=dom-window-postMessage-2><a
-    href="#postmessage">postMessage()</a></code> on document B, then a
-    message event will be fired on that element, marked as originating from
-    document A. The script in document A might look like:</p>
+    href="#postmessage">postMessage()</a></code> on the <code><a
+    href="#window">Window</a></code> object of document B, then a message
+    event will be fired on that object, marked as originating from the
+    <code><a href="#window">Window</a></code> of document A. The script in
+    document A might look like:</p>
 
-   <pre>var o = document.getElementsByTagName('object')[0];
+   <pre>var o = document.getElementsByTagName('iframe')[0];
 o.contentWindow.postMessage('Hello world', 'http://b.example.org/');</pre>
 
    <p>To register an event handler for incoming events, the script would use
     <code title="">addEventListener()</code> (or similar mechanisms). For
     example, the script in document B might look like:</p>
 
-   <pre>document.addEventListener('message', receiver, false);
+   <pre>window.addEventListener('message', receiver, false);
 function receiver(e) {
   if (e.origin == 'http://example.com') {
     if (e.data == 'Hello world') {

Received on Tuesday, 15 July 2008 10:56:29 UTC