I have a script that gets some JSON data from google apps scriptDB using the content service. I’m using jQuery JSONP (since its obviously cross domain coming from GAS). All is working fine on Chrome & safari, but on IE of course, I’m hitting problems.
I came across this IE/MSDN article which describes that cross domain JSONP would need to be served as a specific mime type to work with IE nowadays – but I don’t believe that in Google Apps Script Content service I can change the mime type to one of the acceptable values.
So instead, I’ve been looking at xDomainRequest – but this code comes up with SCRIPT5: access is denied on IE9 & IE10 on the xdr.open() line.
if (window.XDomainRequest) {
// its IE
var xdr = new XDomainRequest();
xdr.open("get", url);
xdr.onload = function() {
deferred.resolve(JSON.parse(xdr.responseText));
}
xdr.onerror(function() {
deferred.reject("error with IE xdomain request for " + url);
});
xdr.send();
}
else {
$.getJSON(url, null,
function (data) {
deferred.resolve(data);
})
.error(function(res, status, err) {
deferred.reject("error " + err + " for " + url);
});
}
return deferred.promise();
The URL that’s being fetched is
https://script.google.com/macros/s/AKfycbzc0yBs8FfUZyJP1IhGpeTx-MsC288Ml6VYHjnqN9B9Kl3phHuh/exec?panelset=xliberation_panel&callback=?
The entire script is http://xliberation.com/s/badgemanager.html
I’ve seen lot of posts about topics related to this, but I haven’t been able to make anything work. Has anybody definitively figured out JSONP for IE/GAS combination?
File a feature request on the issue tracker; there’s no reason we can’t add the types you need. (And in answer, I don’t think anyone has raised the issue before on the tracker and we weren’t aware of it.)