Jquery AJAX加载和progressbar不兼容?

Jquery AJAX加载和progressbar不兼容?,jquery,jquery-ui,jquery-mobile,Jquery,Jquery Ui,Jquery Mobile,我正在尝试使用AJAX(默认情况下)从jquery移动页面(称为第一页)中的链接加载一个页面(称为第二页)。第二个页面包括一个progressbar(jQueryUI)。当我点击第一页中的链接时,纺车不断旋转,第二页从未加载。有什么我应该知道的吗?我看了很多不同的帖子,但没有找到答案 以下是第一页代码: <html> <head> <meta charset="utf-8"> <link rel="styleshe

我正在尝试使用AJAX(默认情况下)从jquery移动页面(称为第一页)中的链接加载一个页面(称为第二页)。第二个页面包括一个progressbar(jQueryUI)。当我点击第一页中的链接时,纺车不断旋转,第二页从未加载。有什么我应该知道的吗?我看了很多不同的帖子,但没有找到答案

以下是第一页代码:

<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
        <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> 
        <script src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
    </head>
    <body>
        <div data-role="page" id="first_page" data-title="MediaManager">
            <a href="second_page.php">Espace disque</a>
        </div>
    </body>
</html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
        <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
    </head>
    <body>
        <div id="progressbar"></div>
        <script>
                $( "#progressbar" ).progressbar({max: 10 });
                $( "#progressbar" ).progressbar({value: 3 });
        </script>
    </body>
</html>

这是第二页代码:

<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
        <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> 
        <script src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
    </head>
    <body>
        <div data-role="page" id="first_page" data-title="MediaManager">
            <a href="second_page.php">Espace disque</a>
        </div>
    </body>
</html>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
        <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
        <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>
    </head>
    <body>
        <div id="progressbar"></div>
        <script>
                $( "#progressbar" ).progressbar({max: 10 });
                $( "#progressbar" ).progressbar({value: 3 });
        </script>
    </body>
</html>

$(“#progressbar”).progressbar({max:10});
$(“#progressbar”).progressbar({value:3});
谢谢你的帮助

帮助我解决了问题

JQM在使用AJAX调用时不使用,因此我必须在其中包含jqueryui。我已经从第一页删除了已经加载到DOM中的jquery核心。最后,我必须在pagecontainer事件中分配jquery脚本

以下是在我的第二页中使用的代码:

<html>
    <head>
        <meta charset="utf-8">

    </head>
    <body>
        <div data-role="page" id="disk-space" data-title="Espace disque">
            <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css">
            <script src="http://code.jquery.com/ui/1.11.1/jquery-ui.js"></script>

            <div id="progressbar"></div>
            <script>
                $(document).on("pagecontainershow", function () {
                    $( "#progressbar" ).progressbar({max: 10 });
                    $( "#progressbar" ).progressbar({value: 3 });
                });
            </script>
        </div>
    </body>
</html>

$(文档)。在(“pagecontainershow”,函数(){
$(“#progressbar”).progressbar({max:10});
$(“#progressbar”).progressbar({value:3});
});

谢谢你,奥马尔!:-)

您缺少一些代码。您只显示了进度条的一些代码,但我们还需要查看ajax代码。此外,您在解决此问题的过程中尝试了什么?如果我直接在浏览器中访问第二页的URL,此代码将非常有效。jquerymobile为我处理AJAX代码,我只在第一页中使用了一个标记。我可以使用数据AJAX=“false”禁用AJAX,并正确加载页面,但我需要使用AJAX加载页面,所以这不是一个选项。那么,您的第一个页面在哪里呢。很明显,这是有问题的页面,而不是你发布的页面。我已经用代码编辑了问题。让我们来看看。