Same Origin Policy - AJAX & using Public APIs

I know if on my own webpage, if my user is on : http://www.example.com/form.php

and I make an ajax request from that page to : http://example.com/responder.php

It will fail because of the Same origin policy (subdomain is different).

What I am trying to understand is, how is it that AJAX requests can pull data from API's like flickr when the request and server are obviously different.


Edit :

eg: Why does this code work?

$.getJSON('http://api.flickr.com/services/rest/?&;method=flickr...'

(Referred this Community Wiki) Is it using Cross Origin Resource Sharing?

Thanks!

23
задан Community 23 May 2017 в 11:53
поделиться

1 ответ

Существует несколько известных методов работы с одной и той же политикой происхождения. Одним из популярных методов является использование «внедрения тегов сценария», например, в JSONP . Поскольку тег