Closed kapsi1 closed 12 years ago
Yes, you are right. This is the case as of jquery mobile 1.1 rc1. This is due to the fact the jquery-mobile now is AMD compatible, while the adapter is not. By this, when you use requirejs and optimize everything into one module, jquery-mobile is not initialized directly, but the adapter is.
As a workaround, disable the AMD support of jquery-mobile in the first lines:
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define( [ "jquery" ], function ( $ ) {
factory( $, root, doc );
return $.mobile;
});
} else {
// Browser globals
factory( root.jQuery, root, doc );
}
Replace this with:
// Browser globals
factory( root.jQuery, root, doc );
Although this patch you can then still include jquery mobile in a project using requirejs.
In the next release of the adapter, I will add a fix so that the adapter plays more nicely with requirejs (by using the mobileinit
event of jquery mobile...).
Tobias
Thanks.
As of 1.0.7 RC1 this is working again.
Tobias
The 1.0.6 version works when loaded from
of index.html, but when loading with require.js, I get this: