<script type=\"text/javascript\" src=\"/Scripts/jquery-1.8.2.min.js\"></script>
<script type=\"text/javascript\" src=\"/Scripts/jquery.mobile-1.2.0.min.js\"></script>
<script type=\"text/javascript\">
console.log(jQuery.mobile !== undefined && \'good\'); // prints \'good\'!
</script>
<script type=\"text/javascript\" data-main=\"/comp/pages/Index.js\" src=\"/Scripts/require.js></script>
<script type=\"text/javascript\">
console.log(jQuery.mobile !== undefined && \'good\'); // prints \'good\'!
</script>
But in my Index.js, the jQuery.mobile disappears:
require([], function (view) {
console.log(jQuery.mobile === undefined && \'undefined!\'); // prints \'undefined!\'
});
How do I bring mobile back to jQuery ? (I obviously don\’t care about having some mobile in jQuery, but interested in using jQuery Mobile with RequireJS.. just to make it clear..)
Edit 1:
I tried to add require to Index.js:
console.log(jQuery.mobile === undefined && \'undefined!\'); // prints \'undefined!\'
require([\'/Scripts/jquery-1.8.2.min.js\', \'/Scripts/jquery.mobile-1.2.0.min.js\'],
function (jQuery,jqm, view) {
console.log(jQuery.mobile === undefined && \'undefined!\'); // prints \'undefined!\'
});





Rating:
The post javascript – How use jQuery Mobile with RequireJS? appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/javascript-how-use-jquery-mobile-with-requirejs.html
No comments:
Post a Comment