From 9492bff8d3d90ab7daa53b61d51714236ec0bab7 Mon Sep 17 00:00:00 2001 From: proff Date: Wed, 25 Jul 2012 19:08:02 +0400 Subject: [PATCH] Update jquery.ba-postmessage.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit workaround for IE8 (see http://www.felocity.com/article/window_postmessage_problems_and_workarounds_for_ie8) --- jquery.ba-postmessage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.ba-postmessage.js b/jquery.ba-postmessage.js index 5c0fbfe..2203810 100644 --- a/jquery.ba-postmessage.js +++ b/jquery.ba-postmessage.js @@ -109,8 +109,9 @@ if ( has_postMessage ) { // The browser supports window.postMessage, so call it with a targetOrigin // set appropriately, based on the target_url parameter. - target[postMessage]( message, target_url.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) ); - + window.setTimeout(function() { + target[postMessage]( message, target_url.replace( /([^:]+:\/\/[^\/]+).*/, '$1' ) ); + }, 0); } else if ( target_url ) { // The browser does not support window.postMessage, so set the location // of the target to target_url#message. A bit ugly, but it works! A cache