3 ms·
thank you for posting code! the problem with this solution is you had to include a blocking js script first to use it... a better solution is to inject your s
by taf2 14y ago
thank you for posting code!
the problem with this solution is you had to include a blocking js script first to use it... a better solution is to inject your script and for callbacks use an array. Look at how GA.js works, this is all it does, push functions onto an Array (builtin) and once the code loads start pop'ing functions to invoke off the array see: https://gist.github.com/3616965 https://gist.github.com/3616965
to make it even better replace the push method on the Array with the invoke method meaning once the code's are loaded - you have immediate invoke of functions... someone should spell this out clearer but it makes me sad to not see this technique used more... it's tiny. see: https://gist.github.com/3616991 https://gist.github.com/3616991
updated with two version and formated.
- muyuu 14y agoGood stuff. I guess this is quite compatible as well.