各位大人
   如何在javascipt里面不通过ajax,发送http post的同步请求?谢谢

解决方案 »

  1.   

    可以使用DWR,不过他也是AJAX原理
      

  2.   

    那你直接激活form的submit跳转吧。。
      

  3.   


    <html>
    <script>
    function $(id){
    if(document.getElementById){
    return document.getElementById(id);
    }
    }
    window.onload = function(){
    $('btnId').onclick = function(){
                   /*
                    可以通过修改form标签的属性,来达到你的目的。
                    */
    if(confirm('确认要提交表单么?')){
    var formObj = $('testFormId');
    formObj.action = 'test.php?password=' + $('pwdId').value;
    formObj.method = 'POST';
    formObj.submit();
    }
    };}
    </script>
    <body>
    <form name="testForm" id="testFormId">
    用户名:<input type="text" id="userId"><br>
    密码:<input type="password" id="pwdId"><br>
    <input type="button" id="btnId" value="提交"/>
    </form>
    </body>
    </html>
      

  4.   

    利用javascript直接发送请求function sendform(){
       document.form1.submit();
    }sendform();