JQuery "Access Denied" Error

I have a request $.ajax()that requests information about exchange rates from another web server, which is the reason (I believe) for which I receive an "Access denied" error message when called $.ajax().

Is there any way to resolve this type of activity?

+3
source share
1 answer

Yes, you can use JSONP if the remote server can support it (works only with GET requests and works with .ajax ). Another option is to create a bridge server script in the same domain.

, .

:

:

callback({name : "Smith", id : 1})

callback .

, jQuery script DOM:

<script type="text/javascript" src="http://distantdomain.com/?jsonp_callback=someRandomName"></script>

someRandomName JSON.

+4

Source: https://habr.com/ru/post/1746548/


All Articles