简体   繁体   English

jQuery $.mobile 库未定义

[英]jQuery $.mobile library is undefined

I have linked jQuery and jQuery mobile to my code.我已将 jQuery 和 jQuery mobile 链接到我的代码。 I got this error in the console:我在控制台中收到此错误:

TypeError: $.mobile is undefined

I have rechecked the URL and all are correct, I have update the files(jQuery, jQuery mobile) and the issue is still exists.我已经重新检查了 URL,一切都正确,我已经更新了文件(jQuery、jQuery mobile),但问题仍然存在。 I have place the jquery.js before jquery.mobile.js我已经将 jquery.js 放在 jquery.mobile.js 之前

This is my code:这是我的代码:

    <script src="JS/jquery.js" type="text/javascript"></script>
    <script src="//code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.js"></script>
    <script src="JS/bootstrap.min.js" type="text/javascript"></script>
    <script src="JS/code.js" type="text/javascript"></script>   

and it's on the end of the file.它在文件的末尾。 the content of code.js: http://pastebin.com/3LTcxs9S code.js 的内容: http ://pastebin.com/3LTcxs9S

<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.min.js"> 
</script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.3.1/jquery.mobile- 
1.3.1.min.js"></script>

try this by replacing your code通过替换您的代码来尝试此操作

NOTE* put jquery mobile script at last after putting all jquery library scripts, im sure it will work注意* 放完所有jquery库脚本后,最后放jquery mobile脚本,我确定它会工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM