Skip to content

Instantly share code, notes, and snippets.

@0xDing
Created January 18, 2014 13:12
Show Gist options
  • Save 0xDing/8490331 to your computer and use it in GitHub Desktop.
Save 0xDing/8490331 to your computer and use it in GitHub Desktop.
让seajs根据浏览器版本加载适合的jquery库,等效于<!--[if lt IE 9]><script src="jquery-1.9.0.js"></script> <![endif]--><!--[if gte IE 9]><!--><script src="jquery-2.0.0.js"><</script> <!--<![endif]-->
var h5 = -[1,]; //判断是否为现代浏览器
seajs.config({
alias: {
'jquery': 'libs/jquery'+(h5 ? '2.0.3' : '1.10.2')+'/jquery'
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment