$.ajax({
type : "get",
//async:false,
url : "http://127.0.0.1:8080/html/test.txt",
dataType : "jsonp",
jsonpCallback : "success_jsonpCallback",
success : function(json) {
},
error : function() {
alert(strs);
}
});
上面那个jsonpCallback属性好像$.ajax下没有的吧?是可以自定义的吗?那怎么认啊
怎么没有 http://api.jquery.com/jQuery.ajax/
jsonpCallback
Type:
String
orFunction()
Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function.