ajax 调用示例

          $.ajax({
                type: "post",
                url: url,
                data:  { "key": "ValidateMobile", "phone": phone },
                async: false,
                dataType: "json",
                cache:false,
                success: function (msg) {
                    if (msg.returncode != "0") {
                        $.AmHelper.ShowMsg(msg.message)
                    }
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(XMLHttpRequest.status);
                    alert(XMLHttpRequest.readyState);
                    alert(textStatus);
                },
        
                complete: function (XHR, TS) { XHR = null }
            });

 

posted on 2014-11-17 14:01  俊树  阅读(262)  评论(0编辑  收藏  举报

导航