Created
August 25, 2015 13:55
-
-
Save qwertypants/258796fb019dd20ff7fe to your computer and use it in GitHub Desktop.
Fire an event when an window property is ready to be used. This assumes that an external script will add the new property on the window object.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This uses Google tracking as an example | |
var interval = setInterval(function () { | |
console.log('searching..') | |
if (window._gaq) { | |
_gaq.push(['_trackPageview', 'Something']); | |
clearInterval(interval); | |
console.log('stop'); | |
} | |
}, 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment