From 1f66f62eea326a42d633e634c0b8db8f4461d7be Mon Sep 17 00:00:00 2001 From: "L. Bradley LaBoon" Date: Thu, 16 Jun 2016 20:23:43 -0400 Subject: [PATCH] Wow, what a typo --- include/navbar.html | 1 - index.shtml | 1 + js/twitter.js | 26 +++++++++++++++++--------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/include/navbar.html b/include/navbar.html index 4be0398..6ab42f9 100644 --- a/include/navbar.html +++ b/include/navbar.html @@ -10,6 +10,5 @@ CF30 A41A 0698 6B1F 6037 208A 3D21 FA83 9D9A 229F
Public key: 9D9A229F Tweets by @BradLaBoon - diff --git a/index.shtml b/index.shtml index 50e4171..f03efbc 100644 --- a/index.shtml +++ b/index.shtml @@ -9,6 +9,7 @@ +
diff --git a/js/twitter.js b/js/twitter.js index 108c335..61ddb77 100644 --- a/js/twitter.js +++ b/js/twitter.js @@ -1,9 +1,17 @@ -!function(d, s, id) { - var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; - if (!d.getElementById(id)) { - js = d.createElement(s); - js.id = id; - js.src = p + "://platform.twitter.com/widgets.js"; - fjs.parentNode.insertBefore(js, fjs); - } -}(document, "script", "twitter-wjs"); +(function() { + var loadTwitterFeed = function() { + if (!document.getElementById("twitter-wjs")) { + var fjs = document.getElementsByTagName("script")[0]; + var js = document.createElement("script"); + js.id = "twitter-wjs"; + js.src = "//platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } + }; + + // Attach onload handler + if (window.addEventListener) + window.addEventListener("load", loadTwitterFeed, false); + else if (window.attachEvent) + window.attachEvent("onload", loadTwitterFeed); +})();