Ajax cross-domain request problem

problem description

now it"s an ajax cross-domain request. The json string format is returned at the background, but I don"t have the background code. Ajax always enters error, but the error status codes returned are 4 and 200. I hope the gods can help me. Thank you

May.02,2022

status code 200 is successful, 4 starts with a failure, 403 forbids access to the server, and 404 indicates that the server cannot find a file or directory

so you just said 4, and it's hard to explain why without a screenshot

for cross-domain, you can use jsonp or server to configure reverse proxy


clipboard.pngXMLHttpRequest.readyState4json
clipboard.png. How to solve this problem?


is it true that your backend interface does not support jsonp at all, so you call it in jsonp mode and return data in json format, and then juery thinks that this is bad data, not the expected jquery, and then enters error?

Menu