Answer the question
In order to leave comments, you need to log in
Is it possible to cross-origin request a VKontakte api site?
Is it possible to cross-origin request a VKontakte api site or only using jsonp?
The page from which the request is made loads with the title Access-Control-Allow-Origin: *
But chrome gives an error
XMLHttpRequest cannot load https://api.vk.com/method/friends.get?order=hints
&fields=first_name%2Clast_…5b8d8e7bb205aafc518829b2c2f07205b4a91.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://ze…com' is therefore not allowed access.
Answer the question
In order to leave comments, you need to log in
Access-Control-Allow-Origin: * is the header that is returned along with the response to the Cross-Domain request. So that your chrome does not display an error, it is necessary that not the page from which the API twitches was loaded with this header, but the VK API answered you with this header. In your case only JSONP
Although having an access_token on the server, nothing prevents me from doing them myself)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question