Norman Cousineau
Norman Cousineau

Reputation: 347

Google App Script Cross Domain

The following cross domain post to a Google Apps Script works on FireFox (18) but not on Internet Explorer 9.

From what I've read, it shouldn't work at all.

Why does it work on Firefox?

var url = "https://script.google.com/macros/s/AK..etc../exec";
var params = "someParams";
var http = new XMLHttpRequest();
http.open("POST", url, true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.send(params);

Upvotes: 2

Views: 1108

Answers (1)

GTM
GTM

Reputation: 644

This is a known issue with IE9. It has limited support for CORS requests and doesn't support setting custom request headers. IE10 supports CORS, so test in IE10(only if you are running Windows 7+) to validate this.

There is a long list of alternate approaches MSDN recommends to alleviate the pain of doing X domain requests. http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx

Upvotes: 1

Related Questions