Erreur : No 'Access-Control-Allow-Origin' header is present
SuperRobot
Messages postés
30
Statut
Membre
-
SuperRobot Messages postés 30 Statut Membre -
SuperRobot Messages postés 30 Statut Membre -
Bonjour,
J'aimerais afficher le contenu d'une page web avec jquery en javascript, mais il y a cette erreur :
Comment puis-je résoudre ceci ???
Merci d'avance.
J'aimerais afficher le contenu d'une page web avec jquery en javascript, mais il y a cette erreur :
Access to XMLHttpRequest at 'https://openload.co/f/5oqJRuojsPU/Betternet.VPN.4.1.0.rar/' from index.html:1 origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Comment puis-je résoudre ceci ???
Merci d'avance.
A voir également:
- Erreur : No 'Access-Control-Allow-Origin' header is present
- Erreur 0x80070643 - Accueil - Windows
- Erreur 4201 france tv ✓ - Forum Réseaux sociaux
- Erreur 4101 france tv - Forum Lecteurs et supports vidéo
- J'aime par erreur facebook notification - Forum Facebook
- Code erreur f3500-31 ✓ - Forum Bbox Bouygues
https://stackoverflow.com/questions/20035101/why-does-my-javascript-code-receive-a-no-access-control-allow-origin-header-i
https://web.dev/cross-origin-resource-sharing/
Mais c'est toujours la même chose.
function createCORSRequest(method, url) { var xhr = new XMLHttpRequest(); if ("withCredentials" in xhr) { // Check if the XMLHttpRequest object has a "withCredentials" property. // "withCredentials" only exists on XMLHTTPRequest2 objects. xhr.open(method, url, true); } else if (typeof XDomainRequest != "undefined") { // Otherwise, check if XDomainRequest. // XDomainRequest only exists in IE, and is IE's way of making CORS requests. xhr = new XDomainRequest(); xhr.open(method, url); } else { // Otherwise, CORS is not supported by the browser. xhr = null; } return xhr; } xhr = createCORSRequest('GET', 'https://openload.co/f/5oqJRuojsPU/Betternet.VPN.4.1.0.rar/'); xhr.onload = function() { var responseText = xhr.responseText; console.log(responseText); }; xhr.onerror = function() { console.log('There was an error!'); }; xhr.send();