ajax 跨域访问

jsonp只能使用get

$.ajax({
				origin: "*",
				url: 'http://SP/api/test',
				type: 'get',
				dataType: 'jsonp',
				crossDomain: true,
				beforeSend: function (xhr) {
								xhr.setRequestHeader("API_KEY", "XX");
								xhr.setRequestHeader("Authorization", "XX");
				},
				success: function (data) {},
				error: function (y) {

				}
});

作者:spike

分类: Nodejs

创作时间:2023-06-25

更新时间:2024-12-09

联系方式放在中括号之中例如[[email protected]],回复评论在开头加上标号例如:#1