Skip to content

Commit

Permalink
[e] (0) oops, extra trailing slash in example
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@1215 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 12, 2008
1 parent 2ca65f2 commit ce2230b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index
Original file line number Diff line number Diff line change
Expand Up @@ -36596,7 +36596,7 @@ o.contentWindow.postMessage('Hello world');</pre>

<pre>document.addEventListener('message', receiver, false);
function receiver(e) {
if (e.origin == 'http://example.com/') {
if (e.origin == 'http://example.com') {
if (e.data == 'Hello world') {
e.source.postMessage('Hello');
} else {
Expand Down
7 changes: 4 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -33946,12 +33946,13 @@ Target: #image1
o.contentWindow.postMessage('Hello world');</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>
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);
function receiver(e) {
if (e.origin == 'http://example.com/') {
if (e.origin == 'http://example.com') {
if (e.data == 'Hello world') {
e.source.postMessage('Hello');
} else {
Expand Down

0 comments on commit ce2230b

Please sign in to comment.