post/get tip in "async method"
reference this:
https://stackoverflow.com/questions/133310/how-can-i-get-jquery-to-perform-a-synchronous-rather-than-asynchronous-ajax-re
function submitMe(url, data) { //get{name:aa,old:17} //post/get,return true false //$.get can't be used here, "async false" ensure that getting the codeValue correctly. var codeValue; $.ajax({ url: url, data: data, success: function (obj) { console.log(obj.code == "0"); if (obj.code != "0") stateText(obj.msg); codeValue = obj.code == "0"; }, async: false }); return codeValue; }