Heim  >  Artikel  >  Backend-Entwicklung  >  $.ajax为何自定义的options无法传进去给回调?

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

WBOY
WBOYOriginal
2016-06-13 12:16:02837Durchsuche

$.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 />

------解决思路----------------------
可以的!
你看看回调函数的 data 参数是什么
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn