Skip to content Skip to sidebar Skip to footer

Why Request To Site Returns Error Access-Control-Allow-Origin

Ok so, i'm making ajax request to site page, and it doesn't return anything - page is valid, but it gives this error in the console . Origin http://localhost is not allowed by Acce

Solution 1:

You are seeing this error because of browsers Same origin policy which prevents XML HTTP requests(AJAX) to be made to other domains and sub-domains. There are many workarounds of which JSONP is favoured among many developers. But, this requires the server/page to which you're making the request to serve JSONP response.


Post a Comment for "Why Request To Site Returns Error Access-Control-Allow-Origin"