Externalise Scripts in <head>

Hi,

I have the following two scripts in the head section of my site. I believe that they are somehow making the site a bit unresponsive. How would I externalise them and how would I call them…

<script type=“text/javascript”>
$(document).bind(“mobileinit”, function () {
$.mobile.ajaxLinksEnabled = false;
});
</script>

<script language=“javascript” type=“text/javascript”>
window.onload = function() {
setTimeout(function(){window.scrollTo(0, 1);}, 100);
}

You would put the script code in a separate file, perhaps called script.js


$(document).bind("mobileinit", function () {
    $.mobile.ajaxLinksEnabled = false;
});

window.onload = function() {
    setTimeout(function(){window.scrollTo(0, 1);}, 100);
}

and call it with:


<script src="script.js"></script>

Lazy Loading Asyncronous Javascript | Friendly Bit