jQuery mobile不能在浏览器中正常运行解决办法

本人通过导入离线文件包的形式,导入jQuery mobile库,不能在chrome浏览器上正常运行(都是最新版)。可能某些方面不兼容,得到第一幅图的界面。通过更改库文件老版本和在线导入,成功执行jQuery mobile,如第二幅图。

 导入离线库文件

 <link type="text/css" rel="stylesheet" href="resource/jquery.mobile-1.4.5.css">
    <script src="resource/jquery.mobile-1.3.2.min.js"></script>
    <script src="resource/jquery.mobile-1.4.5.js"></script>

 导入老版本和在线库文件:

 <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <script src="http://code.jquery.com/jquery-2.2.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

第二次出现版本不兼容,在popup小部件 

原因是jQuery2.2.1不能执行,换成2.1.4.可在http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js下载这个版本(csdn收费)

  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <script src="http://code.jquery.com/jquery-2.2.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

猜你喜欢

转载自blog.csdn.net/qq_42036616/article/details/82083446