jQuery API | jQuery API 中英文对照版 |
$.ajaxSetup(settings) |
$.ajaxSetup(settings)
Ajax请求全局设置,详细请$.ajax选项描述。 返回值:undefined 参数:
示例: 设置默认请求url为"/xmlhttp/",无全局操作权限,用POST方法请求。下面用Ajax请求一些数据!$.ajaxSetup( { url: "/xmlhttp/", global: false, type: "POST" } ); $.ajax({ data: myData }); Setup global settings for AJAX requests. See $.ajax for a description of all available options. Return value: undefined
Example: Sets the defaults for AJAX requests to the url "/xmlhttp/", disables global handlers and uses POST instead of GET. The following AJAX requests then sends some data without having to set anything else. $.ajaxSetup( { url: "/xmlhttp/", global: false, type: "POST" } ); $.ajax({ data: myData }); |