Skip to content

Instantly share code, notes, and snippets.

@joecritch
Created March 15, 2011 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joecritch/871599 to your computer and use it in GitHub Desktop.
Save joecritch/871599 to your computer and use it in GitHub Desktop.
Just asking which is the better way..
// Method 1 - how i would do it (although i've only used other lazy loaders before)
if(!Modernizr.inputtypes.date) {
yepnope({
load : [
'scripts/jquery.js',
'scripts/jquery-ui.js',
'css/jquery-ui.css',
'scripts/datepicker.js'
]
});
}
// Method 2 ... how the article suggests...
yepnope({
test : Modernizr.inputtypes.date,
nope : [
'scripts/jquery.js',
'scripts/jquery-ui.js',
'css/jquery-ui.css',
'scripts/datepicker.js'
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment