I'm current working on some stuff that need to send cross-domain ajax requests. I'm using jQuery 1.7.2 and Resteasy. Here is my ajax request:
$.ajax({ url: Configuration.AjaxUrlPrefix + "/rest/conf/saveoption", data: { save_option: JSON.stringify(optionData) }, type: "POST", dataType: 'text', success: success, error: fail, cache: false }); And I use a interceptor to add some headers to my rest responses:
@Provider @ServerInterceptor public class CrossDomainInteceptor implements PostProcessInterceptor { @Override public void postProcess(ServerResponse response) { MultivaluedMap<String, Object> metadata = response.getMetadata(); metadata.add("Access-Control-Allow-Origin", "*"); metadata.add("Access-Control-Allow-Methods", "*"); metadata.add("Access-Control-Max-Age", "*"); metadata.add("Access-Control-Allow-Headers", "*"); } } It works well in Chrome and FF, but not work in IE8 and IE9. And I didn't see any error in IE developer tool. Could anyone help me?