I assume you don’t have jQuery when you are trying to fetch the window width, so something like this:
<script>
var width = window.innerWidth || document.documentElement.clientWidth;
if ( width < 1100 ) {
var s = document.createElement('script'),
p = document.getElementsByTagName('script')[0];
s.async = true;
s.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js';
p.parentNode.insertBefore(s, p);
}
</script>
If you have jQuery, it’s a bit simpler syntax:
<script>
if ( $(window).width() < 1100 ) {
$('<scr'+'ipt>').attr({
src: 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js',
async: true
}).insertBefore($('script:first'));
}
</script>
I don’t think you will "unload" a version of jQuery by loading another lower version, but that is your call :)