Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/433.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
Javascript 表单打开时暂停元刷新_Javascript_Php_Jquery_Html_Meta Tags - Fatal编程技术网

Javascript 表单打开时暂停元刷新

Javascript 表单打开时暂停元刷新,javascript,php,jquery,html,meta-tags,Javascript,Php,Jquery,Html,Meta Tags,我有一个简单的html页面,每15秒刷新一次,还有一个表单,用户可以在其中发表评论。但是当用户输入注释时,页面会被刷新,因为meta标记会在15秒内刷新页面。当用户点击表单并在表单中输入内容时,我想暂停元刷新。这是我的元标签和表单 <meta http-equiv="refresh" content="15;url=http://xyyyyyyy.com/testn.php"> 这是表格 <form action="http://xtsss.com/tes

我有一个简单的html页面,每15秒刷新一次,还有一个表单,用户可以在其中发表评论。但是当用户输入注释时,页面会被刷新,因为meta标记会在15秒内刷新页面。当用户点击表单并在表单中输入内容时,我想暂停元刷新。这是我的元标签和表单

   <meta http-equiv="refresh" content="15;url=http://xyyyyyyy.com/testn.php">

这是表格

     <form action="http://xtsss.com/testee.php" method="post" id="pc_form">
        <p>

      <div><input type="text" rows="15" style="width:800px" name="message" id="pc_message"></div>
        </p>
     <p>
       <input type="hidden" value="644" name="pid">

        <input type="hidden" value="Comment" name="submit" id="pc_submit">
      </p>
      </form>



只需使用jquery删除元素即可

$('meta[http-equiv=refresh]').remove();
然后,当他完成输入后,再次使用jquery将其放回

$('head').append('<meta http-equiv="refresh" content="15;url=http://xyyyyyyy.com/testn.php">');
$('head')。追加('');

不工作,我已尝试过。如果可能的话,你能详细说明一下吗