diff options
author | mattab <matthieu.aubry@gmail.com> | 2016-07-15 06:01:42 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2016-07-15 06:01:42 +0300 |
commit | 0913140d1ff894f0e942a71ecd2cd2c7c3db7d7d (patch) | |
tree | 8d2e4b1fa1771d5bd57ba54ae44f88bc21481a60 | |
parent | 5b4089c365f89fc291acf5965d67d97a3e65c316 (diff) |
iframe waits for document ready
-rw-r--r-- | tests/javascript/index.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/javascript/index.php b/tests/javascript/index.php index 4339fcd614..18d34e6d78 100644 --- a/tests/javascript/index.php +++ b/tests/javascript/index.php @@ -3099,11 +3099,14 @@ function PiwikTest() { <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"> \ - window.isInsideIframe = function () { \ - var tracker = Piwik.getTracker(); \ - return tracker.hook.test._isInsideAnIframe(); \ - }; \ + $(document).ready(function() { \ + window.isInsideIframe = function () { \ + var tracker = Piwik.getTracker(); \ + return tracker.hook.test._isInsideAnIframe(); \ + }; \ + });\ \ </sc' + 'ript> \ </body></html>\ @@ -3113,6 +3116,7 @@ function PiwikTest() { iframe.contentWindow.document.open(); iframe.contentWindow.document.write(html); iframe.contentWindow.document.close(); + } test("isInsideAnIframe", function() { |