jQuery JS和jQuery Mobile JS不起作用 [英] jquery js and jquery mobile js not working

查看:179
本文介绍了jQuery JS和jQuery Mobile JS不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我真的需要helppp!我正在用atomg编辑器使用phonegap,而我的jquery和jquery mobile无法正常工作.所有.js文件都位于名为js的文件夹中,并且根目录已正确链接.我已经尝试了在线code.jquery.com版本,但仍然无法正常工作.这是我尝试的2个版本.

hi guys i really need helppp!! i am using phonegap with atom editor and My jquery and jquery mobile is not working. All .js file are in a folder named js and the root are properly link. I have try the online code.jquery.com version and it still doesnt work. These are the 2 version i tried.

版本1

 `<link rel="styleheet" type="text/css" href="css/jquery.mobile-
 1.4.5.min.css">
 <link rel="styleheet" type="text/css" href="css/jquery.mobile-1.4.5.css">
 <link rel="stylesheet" type="text/css" href="css/index.css" />
 <script type="text/javascript" src="cordova.js"></script>
 <script type="text/javascript" src="js/index.js"></script>
 <script type="text/javascript"> app.initialize();</script>
 <script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js">
 </script>
 <script type="text/javascript" src="js/jquery.mobile-1.4.5.js"></script>
 <script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
  `

version2

 <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/mobile/1.4.5/jquery.mobile-
   1.4.5.min.js"></script>
  <script
   src="https://code.jquery.com/jquery-3.2.1.min.js"
   integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
   crossorigin="anonymous"></script>
   <link rel="stylesheet" type="text/css" href="css/index.css" />
   <script type="text/javascript" src="cordova.js"></script>
  <script type="text/javascript" src="js/index.js"></script>
   <script type="text/javascript">app.initialize();</script>

我使用此代码来测试我的jquery是否正常工作

i use this code to test if my jquery is working

   `<script>
 window.onload = function(){
  if (window.jquery){
    alert("YES");
  }else {
    alert("ERROR");
  }
 }
  </script>
   `

并且每次出现错误时,我都会对其进行编程,并且永远不会出现YES 错误

and everytime it turn up to be error i programmed and never turn out YESERROR

有人可以帮我吗?百万感谢

Can anyone help me with this? A MILLION THANKSSSS

推荐答案

jQuery和jQuery mobile在项目中不起作用,因为jQuery mobile 1.4.5版本不支持jQuery 3.x.

jQuery and jQuery mobile are not working within your project because version 1.4.5 of jQuery mobile doesn't support jQuery version 3.x.

尝试在您的应用程序中使用jQuery 2.x版本,看看是否可以解决问题.要快速进行测试,您可以使用Google托管的jQuery来确保在下载所有文件之前:

Try using jQuery version 2.x within your application and see if this fixes the problem. To quickly test this you can use Google's hosted jQuery just to make sure before you go downloading all the files:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>

jQuery mobile 1.5.0于今年5月发布,它实际上支持jQuery3.x.切换到新版本的jQuery mobile也可以解决,但是请记住1.5.0是Alpha版本.您可以在此处

jQuery mobile 1.5.0 was released in May this year which actually supports jQuery 3.x. Switching to the new version of jQuery mobile could also be a fix, but keep in mind that 1.5.0 is an Alpha version. You can read more about the latest version of jQuery mobile here

这篇关于jQuery JS和jQuery Mobile JS不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆