Permalink
Browse files

changes js to async load

  • Loading branch information...
1 parent b7361f1 commit f7adb2707663f9a5899ecc78b8d2de90e21cebab @mikevalstar committed Oct 12, 2012
Showing with 21 additions and 3 deletions.
  1. +21 −3 views/layout.jade
View
@@ -18,9 +18,27 @@ html(lang="en")
link(rel='stylesheet', href='/css/style.min.css')
- script(src='http://code.jquery.com/jquery-1.8.2.min.js', type='text/javascript')
- script(src='/js/jquery.tweet.js', type='text/javascript')
- script(src='/js/mikevalstar.js', type='text/javascript')
+ script(type="text/javascript")
+ (function() {
+ var x = document.getElementsByTagName('script')[0];
+ var s = document.createElement('script');
+ s.type = 'text/javascript';
+ s.async = true;
+ s.src = 'http://code.jquery.com/jquery-1.8.2.min.js';
+ x.parentNode.insertBefore(s, x);
+
+ s = document.createElement('script');
+ s.type = 'text/javascript';
+ s.async = true;
+ s.src = '/js/jquery.tweet.js';
+ x.parentNode.insertBefore(s, x);
+
+ s = document.createElement('script');
+ s.type = 'text/javascript';
+ s.async = true;
+ s.src = '/js/mikevalstar.js';
+ x.parentNode.insertBefore(s, x);
+ })();
script(type="text/javascript")
var _gaq = _gaq || [];

0 comments on commit f7adb27

Please sign in to comment.