Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
122 views
in Technique[技术] by (71.8m points)

javascript - How do I Make Google Apps Script serve XML to IE 11?

I have a google app script attached to a spreadsheet. It's deployed as a web app. When accessed, it returns XML.

function doGet()
{
  var xml = createXML_(getSheetData_())
  Logger.log("
" + xml);
  xml = ContentService.createTextOutput(xml);
  xml.setMimeType(ContentService.MimeType.XML);
  return xml;
}

I have javascript in a webpage that retrieves the XML from this, with a GET request, using XMLHttpRequest() like normal. It then traverses the XML and builds a table from the data.

In Chrome and Firefox, this all works perfectly. However, in IE11, it doesn't work.

Upon further examination (in IE's inspect thing), the XML being returned to IE is:

<Permission Denied>

and that's it.

How do I make my google app script return the XML when requested by Internet Explorer?

question from:https://stackoverflow.com/questions/65932204/how-do-i-make-google-apps-script-serve-xml-to-ie-11

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you mean that Google app script that is deployed as a web app on another domain and your web page is hosted on another domain from where you are trying to retrieve the XML using JS then it can be possible that IE is preventing you from accessing the resources across different domains.

I suggest you try to go to the Internet options-> Security tab-> Select the desired zone-> Custom level then enabled the Access data sources across domains option under the Miscellaneous category.

enter image description here

Restart the machine and again try to check for the issue.

If the issue still persists then I suggest you try to provide detailed steps with the sample code to reproduce the issue and also try to share the snapshot of the error may help to understand the issue in a better way.

Thanks for your understanding.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...