如果我要使用以下方法设置未来的 ajax 调用:
$.ajaxSetup({
url: '/WebServices/AjaxService.asmx',
type: 'POST',
dataType: 'json',
contentType: 'application/json; charset=utf-8'
});
有什么办法可以在以后的调用中附加服务名称吗?像这样:
$.ajax({
url: '+=/ServiceName'
});
还是全局变量是我最好的选择?