M
M
mantovpinets2017-08-10 14:20:45
In contact with
mantovpinets, 2017-08-10 14:20:45

Why is an https domain being blocked by the Access-Control-Allow-Origin rule?

I've been working on vk.api for maybe two weeks now)))
The crux of the matter is this. I'm trying to get group photos and display them on the site via vk.api. I wrote a php script for this. The whole joke is that if I run this script manually, it works and the data comes in the right format. There are no problems here. But if the request is executed when the site loads, then the Access-Control-Allow-Origin error takes off. And this is despite the fact that the site is on the https protocol and the domain is specified as the base one in the application settings. In the server settings, the Access-Control-Allow-Origin "*" option is specified, and on the site I have already screwed the Instagram API, which works fine. What can be a jamb?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serezha, 2017-08-10
Ahen @Ahen

And what about vkontakte? What about app settings?
You are trying to load your script on your server, VK has nothing to do with it at all.
Put a gasket in your php:

<?php header('Access-Control-Allow-Origin: *');  ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question