jquery post 提交等待 同步處理

來源:互聯網
上載者:User

標籤:blog   http   io   ar   os   sp   div   on   問題   

post可以實現同步和非同步,在不同的情境應用不同的方式。在引導嚮導中,使用者提供表單應該等待伺服器返回狀態才能進行下一步。

 bootbox.dialog({message: "請耐心等待,正在向伺服器提交任務...", });//提交建立任務console.log(‘ajax‘)$.ajax({       type: ‘POST‘,        url: ‘/task/testpost/‘,        async: false,        data: {                ‘taskContent‘:$("#step2_taskcontent").text(),        ‘taskCreatorID‘:$(‘#username‘).text(),        ‘workers[]‘:$("#step1_workers").val(),        ‘name‘:‘test‘,        },        success: function(data){        bootbox.hideAll()$(‘#wizard_left‘).hide()//return false        },        error: function(XMLHttpRequest, textStatus, errorThrown) {        bootbox.hideAll()        //console.log(‘error‘)                        //alert(XMLHttpRequest.status);                        //alert(XMLHttpRequest.readyState);                        alert("建立服務單失敗,可能是網路連接有問題,請與管理員聯絡。錯誤:"+textStatus+","+XMLHttpRequest.status+","+XMLHttpRequest.readyState);return false                        }//參數結束    });

 

 

jquery post 提交等待 同步處理

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.