I have a web page that has to be correctly displayed on mobile devices. To do so, i loaded JQuery Mobile script in the page\'s head. The head tag looks like this:
Its hard to detect whether your device is mobile or tablet or huge screen with touch, but to start with
Like this (should work for jQuery script from http://detectmobilebrowsers.com/) :
yepnope({
test : jQuery.browser.mobile,
yep : 'mobile_specific.js',
nope : ['normal.js','blah.js']
});
EDIT:
Also have a look at https://github.com/borismus/device.js, for loading content based on conditions. I am not sure whether it will allow you to load conditional JS files.