JQuery和JQuery mobile出现错误

Errors mixup JQuery and Jquery mobile

本文关键字:JQuery 错误 mobile      更新时间:2023-09-26

JQuery和JQuery mobile有一些问题。当我点击页面中的链接时,我会出现以下错误:

未捕获错误:无法在初始化之前调用页面上的方法;试图调用方法"bindRemove"

我试图改变链接rel和脚本的位置,但它破坏了我的设计。。。

有人有主意吗?

这是我的代码:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- Include meta tag to ensure proper rendering and touch zooming -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Accueil</title>
    <!-- CSS -->
    <!-- Include jQuery Mobile stylesheets -->
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <!-- CSS splashscreen -->
    <link rel="stylesheet" type="text/css" href="css/wemind/splashscreen.css" />
    <link rel="stylesheet" type="text/css" href="css/wemind/styles_wemind.css" />
    <!-- JS -->
    <!-- Include the jQuery library -->
    <script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
    <!-- Include the jQuery Mobile library -->
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <!-- Scripts splashscreen -->
    <script src="js/jquery.splashscreen.js"></script>
    <script src="js/script_splashscreen.js"></script>
</head>
<body>
<div id="promoIMG" />
<div data-role="page" id="main-page">
    <div id="actionbar-main"><img src="img/ic_launcher.png" /></div>
    <p class="text-accueil">Qui &ecirc;tes-vous ?</p>
    <div id="student-link"><a href="login.php" data-transition="slide"><img src="img/ic_student.png" /></a></div>
    <p class="wemind-font">Student</p>
    <div id="horiz-sep-main"><img src="img/ic_sep.png" /></div>
    <div id="parent-link"><a href="login.php" data-transition="slide"><img src="img/ic_teacher.png" /></a></div>
    <p class="wemind-font">Teacher</p>
</div>

提前感谢

js/脚本中的某些内容试图在初始化Mobile小部件之前对其进行操作。查找使用bindRemove作为参数的任何函数,并在不带任何参数的情况下调用它,以便在调用bindRemove之前初始化其小部件。

我试过这个:

<script>
    $( document ).ready(function() {
        $( "a" ).click(function( event ) {
                window.location = $(this).attr("href");
        });
    });
</script>

我把这个放在但当我注销时,我被重定向到此页面,问题再次出现。。。我应该可以毫无问题地点击链接,用这么简单的代码很奇怪!