diff options
author | mattab <matthieu.aubry@gmail.com> | 2016-07-15 06:59:37 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2016-07-15 06:59:37 +0300 |
commit | fc50d2b80810f2c34e2b58ef41ad970e3c5b261d (patch) | |
tree | efd634a9c14e1014845ceaa0b0d231a13c248c7f | |
parent | 2e6eea55eb54f57386a18e389ae23a5d6bf86b8c (diff) |
Fix for IE9: wait for window.onload
-rw-r--r-- | tests/javascript/index.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php index afd155c578..eea3ffac96 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -3101,20 +3101,22 @@ function PiwikTest() { var hostAndPath = $(location).attr('pathname'); var iframe = document.createElement('iframe'); iframe.id = "iframeTesting"; - iframe.style= "display : none"; + iframe.style = "display : none"; var html = '\ <html><body> \ <scr' + 'ipt src="' + hostAndPath + '../../js/piwik.js?rand=<?php echo $cacheBuster; ?>" type="text/javascript"></sc' + 'ript> \ <scr' + 'ipt src="' + hostAndPath + 'piwiktest.js" type="text/javascript"></sc' + 'ript> \ <scr' + 'ipt src="' + hostAndPath + '../../libs/bower_components/jquery/dist/jquery.min.js" type="text/javascript"></sc' + 'ript> \ <scr' + 'ipt type="text/javascript"> \ - $(document).ready(function() { \ - window.iframeIsLoaded = true; \ - window.isInsideIframe = function () { \ - var tracker = Piwik.getTracker(); \ - return tracker.hook.test._isInsideAnIframe(); \ - }; \ - }); \ + window.onload = function() { \ + $(document).ready(function () { \ + window.iframeIsLoaded = true; \ + window.isInsideIframe = function () { \ + var tracker = Piwik.getTracker(); \ + return tracker.hook.test._isInsideAnIframe(); \ + }; \ + });\ + }; \ window.iframeIsLoaded = false; \ \ </sc' + 'ript> \ |