$.ajax为何自定义的options无法传进去给回调?

WBOY
Release: 2016-06-13 12:16:02
Original
874 people have browsed it

$.ajax为什么自定义的options无法传进去给回调????

本帖最后由 jianye112 于 2015-03-09 23:53:25 编辑 $.ajax为什么自定义的options无法传进去给回调????

//单击执行AJAX请求操作<br />function clickSubmit(sendUrl, data, _sucmsg, _errmsg){<br />	$.ajax({<br />		type: "POST",<br />		url: sendUrl,<br />		dataType: "json",<br />		timeout: 20000,<br />		data: data,<br />		sucmsg: _sucmsg,		//????????????????????????<br />		errmsg: _errmsg,          //????????????????????????<br />		success: function(data, textStatus) {<br />			if (data.status == 1){<br />				$.dialog.tips(this.sucmsg ? this.sucmsg : data.msg, 2, "32X32/succ.png", function(){<br />					//location.reload();<br />			    });<br />			} else {<br />				$.dialog.alert(this.errmsg ? this.errmsg : data.msg);<br />			}<br />		},<br />		error: function (XMLHttpRequest, textStatus, errorThrown) {<br />			$.dialog.alert("状态:" + textStatus + ";出错提示:" + errorThrown);<br />		}<br />	});<br />}<br />
Copy after login

------解决思路----------------------
可以的!
你看看回调函数的 data 参数是什么
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template