I sent ajax request from 'sub.example.com' to 'www.example.com/api/lists'(yes, it is subdomain), but it's not working only IE. It's working on FF, Chrome, Safari and other mobile browser.
Error Message - SEC7120 : Origin http://sub.example.com is not allowed by Access-Control-Allow-Origin.
My server setting is
<?php
header('Access-Control-Allow-Origin : *');
header('Access-Control-Allow-Methods: GET, PUT, POST, DELETE, OPTIONS');
I tried two ways. first, jQuery.ajax();
$.ajax({
url : 'http://www.example.com/api/lists',
type : 'GET',
dataType : 'JSON',
cache : false,
crossDomain : true
}).success(function(data){
// do something
});
and navtive javascript.
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://www.example.com/api/lists');
xhr.send();
both of them not working only IE10 Browser.(not tested lt IE10 yet)