在线文档教程

js定时post提交

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<title>post提交</title> 
</head>
<body>
<iframe id="iframe_display" name="iframe_display" style="display: none;"></iframe>  
<form name="guo" action="/" method="post" target="iframe_display">
  <div>
    <label for="name">type:</label>
    <input type="text" name="type" value="1"/>
  </div>
  <div>
    <label for="passwd">orderid:</label>
    <input type="text" name="orderid" value="0"/>
  </div>
</form>
<button onclick="my()">点我</button>
<script>
function my(){
    setInterval(function(){
        setTimeout("document.guo.submit()")  
    },1000);
    return false;
}
</script> 
</body>
</html>