蘋果微信瀏覽器不能post方式提交數據問題


form表單中采用post方式提交數據時,在蘋果的微信瀏覽器中無法傳遞,安卓的可以

如圖:

在controller中獲取該數據為 null 

將表單的提交方式修改為get就能夠獲取到

現在采用Ajax方式進行提交,類似於

 <div class="main">
      <form id="loginform">
      <input type="hidden" id="forward" value="${forward}"></input>
        <div class="item">
          <input class="txt-input txt-username" type="text" placeholder="請輸入用戶名/手機號" id="custid" name="username">
          </div>
        <div class="item">
          <input  type="password" placeholder="請輸入密碼"  class="txt-input txt-password ciphertext" id="password" name="password" style="display: inline;">
          <input type="text" placeholder="請輸入密碼" class="txt-input txt-password plaintext"   style="display: none;" name="ptext">
          <b class="tp-btn btn-off"></b> 
        </div>
        <input type="button" class="button" value="登錄" onclick="login()" id="btnlogin">

      </form>
    </div>

 aJax提交form表單

    function login() {
        if (!$('#custid').val()) {
            $('#custid').focus();
            $("#custid").testRemind("用戶名不能為空!"); 
            return false;
        }
        
        if (!$('#password').val()) {
            $('#password').focus();
            $("#password").testRemind("密碼不能為空!");
            return false;
        }
        $("#btnlogin").val("正在登錄中");
        var pswd = $('#password').val();
        $('#password').val($.des.getDes(pswd)).hide();
        $("#btnlogin").attr("disabled", "disabled");
        $("#loginform input").addClass("readonly").attr("readonly", "readonly");
        $.ajax({
              type:"post" ,
              data: {
                  username:$('#custid').val(),
                  password:$('#password').val()
              },
              dataType : "json",
              url: "${current_url}newlogin.action",
              success: function(data){
                  $("#btnlogin").attr("disabled", false);
                    $("#loginform input").removeClass("readonly").attr("readonly", false);
                      if(data.result=="1"){
                          window.location.href = data;
              
                  }else{
                      if(data.message == '賬戶已鎖定請聯系管理員解鎖'){
                            jAlert("您的賬戶已被鎖定,請聯系客服解鎖!",'提示');
                        }else{
                            
                            jAlert(data.message,'提示',function(r){
                                $("#password").val(pswd).show();
                            });
                        }
                      $("#btnlogin").val("登錄");
                      $('#custid').val("");
                      $('#password').val("");
                      return false;
                  }
              },
              error : function(data){
                  jAlert('系統繁忙,請稍后!','提示',function(r){
                      $("#btnlogin").val("登錄");
                      $('#custid').val("");
                      $('#password').val("");
                      return false;
                  });
                  
              }
          });
    }

 

            /*ajax start*/
          /* $.ajax({
            url:"${pathWeb}/user/tgRecharge.do",
            type:"post",
            data:{pay_money:pay_money},
            success:function(){
                alert(data); 
            },
            error:function(e){
                alert("錯誤!!");
                window.clearInterval(timer);
            }
        });     */
        /*ajax end*/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM