Joseph,
I do not know if it is your knowledge, but this something on the server side, which in your case is PHP. That is, it is not in HTML that you will fix, but in PHP. This is a matter related to CORS or Cross-origin Resource sharing. Read the link I left.
Giving my explanation to help you understand, a web application can freely upload images, stylesheets, scripts, iframes, videos and plugins like Adobe Flash from any domain. However, web fonts and Ajax requests are only limited to within the domain itself, and in your case, probably from an X domain you are making an Ajax request to the Y domain or loading the source of a Z domain.
This happened once with me when of a web application, which was in a domain(http://localhost:8080/myapplication/), i performed an Ajax request on a web service, which was in different domain(http://localhost:8080/meuwebservice/).
I decided to add only in the header of my web service the permission for this type of request. In my case it was Java, but since you are making use of PHP, the solution will be to add the following line of code:
header('Access-Control-Allow-Origin: *');
In the code above, we are releasing for requests from any and all domains, because, as is common in our world, *
indicates something like ALL. If you want to specify which specific domains to request, simply replace the *
by the address thus:
header('Access-Control-Allow-Origin: http://meusite.com', false);
header('Access-Control-Allow-Origin: http://outrosite.com', false);
header('Access-Control-Allow-Origin: https://www.maisum.com', false);
I hope I helped something, anything leave a comment!
What language do you have on the server?
– Sergio
Only PHP, using xampp
– José Darci Rodrigues Jr
Okay, have you tried putting in PHP
header('Access-Control-Allow-Origin: *');
as indicated in the answer below?– Sergio
Yes Sire, it was done but it didn’t work, the message remains the same.I’m trying differently. It would be easier if I used the video tag, but since src is an IP cam, I can’t because of this problem.
– José Darci Rodrigues Jr
Jose, just to clarify if you were the one who denied the answers below that indicate the use of the header via head(), it is not because it did not work with you that you should deny the answers. It doesn’t work like that, you have the opportunity to comment below saying that it didn’t work so that the person can seek new solutions for you.
– Tássio Auad