Let Me Tink About It
Let Me Tink About It

Reputation: 16122

Access-Control-Allow-Origin headers in GAS

I am sending an (HTTP GET) $.ajax request (from jsfiddle) to my Google Apps Script server and I get the following error:

XMLHttpRequest cannot load https://script.google.com/macros/s/mykey?params.

Origin http://fiddle.jshell.net is not allowed by Access-Control-Allow-Origin.

What is the best way to solve this problem?

I have successfully implemented jsonp $.ajax requests to retrieve json data and javascript using this GAS/jsfiddle configuration. However, I seem unable to accomplish this jsonp success this time. Possibly because I am going through an .updaterow() function (per jqWidgets?)

My research:

  1. This post almost asks a similar question except it is not specific to GAS.
  2. I do not think GAS allows one to set server-side response headers. But surely there must be a way to get my request to execute?
  3. Perhaps this question explains it better? (GAS issue) Is there a workaround solution? (Come on creative people.)

Upvotes: 0

Views: 1884

Answers (1)

Let Me Tink About It
Let Me Tink About It

Reputation: 16122

GAS does not allow CORS headers at this time.

Upvotes: 2

Related Questions