I’m really struggling with require.js and jquery mobile. I have a loosely based file structure and loading pattern based off of
https://github.com/appboil/appboil-requirejs-backbonejs-jquerymobile-phonegap
but it’s old and I had to make adaptions for the require 2.0 version. Is there a community accepted way of using jquery mobile, backbonejs and requirejs together? I’d like to use backbone’s routing and not jquery mobiles. Additionally, that template has phonegap, which i’m not concerned with.
Here is the main.js file I use…
The last bit is very important to get JQM to load correctly (and actually function). This part:
Since i need jquery for jqm (jquery mobile), i’ll load them all and thanks to the shim code above, the dependencies are loaded in the correct order. I don’t actually pass any jqm variable into the function call, which only passes $ and App. The next important part is the jqm-config file:
You can place all of your preinit code for jqm in that file. After all that, you should be able to use jqm!