With performance optimizations and non-blocking scripts in the header, I'm trying to asynchronously load jquery itself.
I came across a jQuery Loader script that async loads jquery and after that catches and queues jquery document ready calls. This seems to work most of the time, but not always.
So, I created a backup to load the local version of jquery, if the bootloader did not finish within x seconds. Backup work, but not completely. Some parts may work, others not.
Script is still being called in the header after loading the jquery script bootloader:
<script type="text/javascript">
function loadScript(url)
{
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
head.appendChild(script);
}
var fallback_timer = setTimeout(function() {
loadScript('/path/to/local/js/jquery.js');
},5000);
jQl.loadjQ('//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js',function({clearTimeout(fallback_timer);});
</script>
Questions:
, jQuery, jquery , , jquery, - .