Ajax encountered problems that could not be sent, and no return information was received.

1.When I did ajax, the data was sent successfully, and the background confirmed that the message was returned, but it couldn’t be received in success anyway. The reason I met was due to the wrong dataType return value type.

var url = "Request data interface / path ";$.ajax ({Method:'post',Async:false,DataTye:'json',Url:url,Success:function (data)) {Console.log ("return value" +data);}})

In the last section of Ajax sending, the background gave me a text-type data when I returned, but my dataType was written as json, causing how to print out the returned data, small details, can not be careless.

2.When you send Ajax once, Ajax goes into error, and the reason I’m currently encountering is because of a data data error.

$.ajax({
	method:'get',
	async:false,
	data: $("#data_form").serialize(),
	url:url,
	success:function(){
		//Successful sending},The function called error:function (info) is / / after the request fails.//ajax request failed}})

There is a time in my data.

The big guy let me delete the time and then I can ask for it normally.

The reason may be that the data is not in the right format and that the particularity of the date and time should be handled.

 

Leave a Reply

Your email address will not be published. Required fields are marked *