jquery ajaxを使い、他サーバーにパラムを送りデータを取得しようと思っていたのですが
Status Code: 200 OKで送れてはいるのですが
Failed to load https://.jp/++++/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://.jp' is therefore not allowed access.
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://*****.jp/++++/ with MIME type text/xml. See https://www.chromestatus.com/feature/5629709824032768 for more details.
というエラーが返ってきてしまいレスポンスが取得できません
jquery
1$.ajax({ 2 url: "https://*****.jp/++++/vkey:" + vkey 3 ,type: 'POST' 4 ,data : param 5 , xhrFields: { 6 withCredentials: true 7 } 8 9 }).done(function(data, textStatus, jqXHR){ 10 console.log(data); 11 12 }).fail(function(jqXHR, textStatus, errorThrown){ 13 14 });
サーバー側の問題なのはわかっていてhtaccessは下記のように記入しています
htaccess
1<IfModule mod_rewrite.c> 2 RewriteEngine On 3 RewriteCond %{REQUEST_FILENAME} !-d 4 RewriteCond %{REQUEST_FILENAME} !-f 5 RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] 6 RewriteCond %{HTTP:Origin} (.+) 7 RewriteRule . - [E=CORS_ORIGIN:%1] 8 Header set Access-Control-Allow-Origin %{CORS_ORIGIN}e env=CORS_ORIGIN 9 Header set Access-Control-Allow-Credentials true 10</IfModule>
よろしくお願いします
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/25 06:54