Home >Web Front-end >JS Tutorial >Use jsonp to perfectly solve cross-domain problems_javascript skills
Call the web interface, get request, and find the prompt: No 'Access-Control-Allow-Origin' header is present on the requested resource.
This is related to the security mechanism, cross-domain calls are not allowed by default
Processing method: Use jsonp format, ajax request parameter dataType:'JSONP'.
}
});
Hey, this is really difficult for those who don’t know it, but it’s not difficult for those who know it. A simple line of code solves this big problem. . . . Cry~