Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Can';刷新HTML页面_Php_Jquery_Html_Jquery Ui_Jquery Mobile - Fatal编程技术网

Php Can';刷新HTML页面

Php Can';刷新HTML页面,php,jquery,html,jquery-ui,jquery-mobile,Php,Jquery,Html,Jquery Ui,Jquery Mobile,我有个问题。我用jQuery、jQueryUI、jQueryMobile和kineticjs制作了一个HTML和PHP页面。切换到其他页面时,不要刷新整个页面。我也尝试过使用,但没有成功。 在该页面中,我还使用php从该php获取结果。以下是我的php页面中的代码: <?php if ( isset($_POST['address']) && isset($_POST['prefix']) && isset($_POST['levels']) ) {

我有个问题。我用jQuery、jQueryUI、jQueryMobile和kineticjs制作了一个HTML和PHP页面。切换到其他页面时,不要刷新整个页面。我也尝试过使用
,但没有成功。 在该页面中,我还使用php从该php获取结果。以下是我的php页面中的代码:

<?php
    if ( isset($_POST['address']) && isset($_POST['prefix']) && isset($_POST['levels']) ) {
        require_once 'convert.php';
        $network = new Network($ip, $prefix, $levels);
        print_html($network);
        exit();
    }
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="refresh" content="URL=aa.php">
        <title>aa</title>
        <link rel="stylesheet" href="css/jquery-ui.css" />
        <link rel="stylesheet" href="css/jquery.mobile-1.3.0.css" />
        <script src="js/jquery-1.9.1.js"></script>
        <script src="js/jquery.mobile-1.3.0.js"></script>
        <script src="js/jquery-ui.js"></script>
        <script src="js/kinetic-v4.3.2-beta.js"></script>
    </head>
    <body>
        <div data-role="page">
            <div data-role="header">
                <h3>aa</h3>
            </div>
            <div data-role="content">
                <h3>aa</h3>
                <br />
                <div>
                    <label for="address">Address:</label>
                    <input type="text" id="address">
                    <select id="prefix">
                        <?php for ( $i = 49; $i < 64; $i++ ) : ?>
                        <option value="<?php echo $i; ?>">/<?php echo $i; ?></option>
                        <?php endfor; ?>
                    </select>
                    <label for="subnet">Total Subnets: </label>
                    <input type="text" id="subnets">
                    <button class="btn" id="build"> Build It </button>
                </div>

                <div id="network"></div>
            </div>
        </div>

        <script src="js/jquery.js"></script>    
        <script type="text/javascript">
            $(function(){
                $("#build").click(function(){
                    var subnets = parseInt( $("#subnets").val() );
                    var address = $("#address").val();
                    var prefix = $("#prefix").val();
                    var levels = $("#subnets").val();
                    $.post("aa.php", {address:address, prefix:prefix, levels:levels}, function(response){
                        $("#network").html(response);
                        $("#network > .branch").show();
                        $("#network .open-children").click(function(){
                            $(this).text('-');
                            $(this).parent().children(".branch").toggle();
                            return false;
                        });
                    });
                });
            });
        </script>
    </body>
</html>

aa
aa
aa

地址:
元刷新的工作原理应该是:

<meta http-equiv="refresh" content="0;url=aa.php">

您可以在没有JS的情况下使用它

<noscript><meta http-equiv="refresh" content="0;URL='?nojs=1'"></noscript>

检查console中是否有任何错误并将其删除。此外,您还应该检测是否有手机版或PC版的浏览器,并包括jquery-1.9.1.js或jquery.mobile-1.3.0.js

你也可以使用

窗口位置


使用setInterval或setTimeout,它也会这样做。但是您不能有任何JS错误。

您可以使用以下javascript代码刷新页面:

document.location.reload();
或更改您的位置(如果需要):

document.location = "http://google.com";
试试这个

<meta http-equiv="refresh" content="0;url=aa.php">


看起来您包含了两次jQuery。删除第二个引用。我在div之后删除了jQuery。结果是一样的。不起作用。不要插入整个源代码。尝试将代码减少到仍然会产生问题的最小值。但是它不能。我不知道为什么。如果我使用你说的,在我手动刷新页面后,它总是每秒刷新一次。。