Why do some sites (or advertisers that give clients javascript code) employ a technique of splitting the and/or
tags
The solution Bobince posted works perfectly for me. I wanted to offer an alternative method as well for future visitors:
if (typeof(jQuery) == 'undefined') {
(function() {
var sct = document.createElement('script');
sct.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js';
sct.type = 'text/javascript';
sct.async = 'true';
var domel = document.getElementsByTagName('script')[0];
domel.parentNode.insertBefore(sct, domel);
})();
}
In this example, I've included a conditional load for jQuery to demonstrate use case. Hope that's useful for someone!