作者:焦鹏666_479 | 来源:互联网 | 2023-05-16 17:31
But in my Index.js
, the jQuery.mobile
disappears:
但是在我的Index.js中,jQuery.mobile消失了:
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..)
如何将移动设备带回jQuery? (我显然不关心在jQuery中使用一些移动设备,但是对使用带有RequireJS的jQuery Mobile感兴趣...只是为了说清楚..)
Edit 1:
I tried to add require
to Index.js:
我试图向index.js添加require:
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!'
});
4 个解决方案