curl(['domReady!']).next(['jquery'], function (jq) {
console.log(typeof jq);
});
curl(['domReady!']).next(['jquery']).next(['js!jquery-migrate'], function (jq) {
console.log(typeof jq);
});
curl(['domReady!']).next(['jquery'], function (jq) {
curl(['js!jquery-migrate'], function () {
console.log(typeof jq);
console.log(jq);
console.log(jq === window.jQuery);
});
});
var curl;
(function () {
var cjsConfig = {
loader: 'curl/loader/cjsm11'
};
curl.config({
baseUrl: baseUrl,
packages: {
app: { location: 'app', config: cjsConfig, main: 'main' },
component: { location: 'component', config: cjsConfig },
curl: { location: 'lib/curl/src/curl/' },
when: { location: 'lib/when', main: 'when' },
poly: { location: 'lib/poly' }
},
paths: {
jquery: 'lib/jquery/jquery.min',
'jquery-migrate': {
location: '//code.jquery.com/jquery-migrate-1.2.1.js',
config: {
loader: 'curl/loader/legacy',
requires: [ 'jquery' ],
exports: '$.migrateWarnings'
}
}
},
preloads: ['poly/es5']
});
curl(['app', 'jquery', 'jquery-migrate']).then(start, fail);
function start(main, $, warnings) {
// tell the jquery migrate plugin to be quiet
$.migrateMute = true;
}
function fail(ex) {
// TODO: show a meaningful error to the user.
//document.location.href = '/500';
throw ex;
}
}());