Better twitter script loading
This commit is contained in:
parent
f8a08c3f08
commit
d390fc651d
@ -10,6 +10,5 @@
|
|||||||
<code>CF30 A41A 0698 6B1F 6037 208A 3D21 FA83 9D9A 229F</code><br />
|
<code>CF30 A41A 0698 6B1F 6037 208A 3D21 FA83 9D9A 229F</code><br />
|
||||||
Public key: <a target="_blank" href="http://pgp.mit.edu/pks/lookup?op=get&search=0x3D21FA839D9A229F">9D9A229F</a>
|
Public key: <a target="_blank" href="http://pgp.mit.edu/pks/lookup?op=get&search=0x3D21FA839D9A229F">9D9A229F</a>
|
||||||
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/BradLaBoon" data-widget-id="716765398503395329">Tweets by @BradLaBoon</a>
|
<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/BradLaBoon" data-widget-id="716765398503395329">Tweets by @BradLaBoon</a>
|
||||||
<script>!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");document.getElementById("twitter-widget-0").style.marginTop="10px";</script>
|
|
||||||
</nav>
|
</nav>
|
||||||
<!--End navbar-->
|
<!--End navbar-->
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||||
<link rel="stylesheet" type="text/css" href="index.css" />
|
<link rel="stylesheet" type="text/css" href="index.css" />
|
||||||
<script type="text/javascript" src="js/navbar.js"></script>
|
<script type="text/javascript" src="js/navbar.js"></script>
|
||||||
|
<script type="test/javascript" src="js/twitter.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
17
js/twitter.js
Normal file
17
js/twitter.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
(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);
|
||||||
|
})();
|
Loading…
Reference in New Issue
Block a user