Skip to content

Commit

Permalink
test "postMessage" in window, not window.postMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
daepark committed Jan 29, 2010
1 parent b1e7964 commit 632190e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.postmessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
msg.errback = pm._callback(o.error);
}

if (window.postMessage && !o.hash) {
if (("postMessage" in window) && !o.hash) {
pm._bind(window);
w.postMessage(JSON.stringify(msg), o.origin || '*');
}
Expand All @@ -61,7 +61,7 @@
pm.bind = function(w, type, fn, origin, hash) {
// TODO: assert w === window
// you can only bind to current window
if (window.postMessage && !hash) {
if (("postMessage" in window) && !hash) {
pm._bind(w);
}
else {
Expand Down

0 comments on commit 632190e

Please sign in to comment.