Jquery 3.0.0与Jquery Mobile不兼容?

use*_*521 6 jquery jquery-mobile

我只是在学习如何编写Javascript.我被告知这是如何包含jquery和jquery mobile:

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet"   
      href="css/jquery.mobile-1.4.5.min.css">
  <script src="scripts/jquery-3.0.0.min.js">
  </script>
  <script 
    src="scripts/jquery.mobile-1.4.5.min.js">
  </script>
</head>
<body>
  <div data-role="page">
    <div data-role=header>My Page</div>
    <div data-role="content">
      <label for="entry">Enter a number:</label>
      <input type='number' name='entry' id='entry' min='0'>
      <button>My button</button>
    </div>
  </div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

上面的页面不呈现移动样式; 它看起来像普通的HTML.但是,如果我将jquery库更改为2.2.4(两者都存在于scripts文件夹中),它可以工作,文本框和按钮看起来像一个移动应用程序,在控制台中没有错误.这里有不兼容的地方吗?此外,当我使用3.0.0时,控制台说:TypeError:a.event.props未定义.我只是好奇这里发生了什么以及为什么我必须使用旧的jquery.

PF4*_*lic 9

根据jquery-mobile github上的这条消息,问题跟踪器jquery-mobile 1.5应该与jQuery 3.x兼容.

目前无法在主网站上找到它,但可以在code.jquery.com上找到


Mat*_*tte 4

jQuery 3 已经发布五天了。它还打破了一些东西前面两个链接中提到的jQuery Migrate可能会让您的设置正常工作,但请考虑不要开辟这条道路。

  • 是的,确实是 (2认同)