diff --git a/public/index.html b/public/index.html index 79fcfde..ffa2060 100644 --- a/public/index.html +++ b/public/index.html @@ -67,7 +67,6 @@

Arrow configuration

- @@ -88,11 +87,28 @@

Arrow configuration

_gaq.push(['_trackPageview']); (function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); + var defer = (function (document, script) { + var urls = [], + firstScript = document.getElementsByTagName(script)[0]; + + return function (url, callback) { + var inc; + if (url && urls.indexOf(url) === -1) { + inc = document.createElement(script); + inc.async = true; + inc.src = url; + inc.onload = callback || function () {}; + firstScript.parentNode.insertBefore(inc, firstScript); + } + } + }(document, 'script')); + + window.onload = function () { + defer(('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'); + defer('//platform.twitter.com/widgets.js'); + }; + })();