Solve cross-domain ajax

$.ajax({
		async: false,
		type: "GET",
		dataType: 'jsonp',
		jsonp: 'callback',
		jsonpCallback: 'callbackfunction',
		url: urlStr,
		data: "",
		timeout: 3000,
		contentType: "application/json;utf-8",
		success: function(msg) {
		  console.log(msg);
		}
	  });

 

wrote
The server side sets Access-Control-Allow-Origin
as long as the server side sets the Access-Control-Allow-Origin in the header of the response to the domain name that can request the data under the current domain name. In general, it can be set. This way the client doesn't need to use jsonp to get the data.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327041879&siteId=291194637