Webアプリケーションで、ajax呼び出しで別のドメインにデータを渡してみてください。しかし、それは、Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://example.com/auth/webschool/test.php. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
CORSヘッダー 'Access-Control-Allow-Origin'がPHPにありません
私のAjaxコードがあるようなエラー、
$.ajax({
type: "POST",
url: "http://example.com/auth/webschool/test.php",
data: {username: "abcd",password:"abcd"},
dataType: "html",
success: function (data) {
alert(data);
}
});
に動作することを期待しています'Access-Control-Allow-Origin'ヘッダ? –
<?php header( "Access-Control-Allow-Origin:*"); header( "Content-Type:text/event-stream"); header( "Cache-Control:no-cache");?> –