No Access control allow origin issue - Jquery

General summary

In jquery I'm trying to post the form values into Google Spreadsheet, my values are posting fine to the google doc, but I'm having an issue in displaying the success message or redirect to a page, the error says  "Failed to load  No ''Access-Control-Allow-Origin" header is present on the requested resource"

Debugging results:
Tried to change the dataType to JSONP or plain/html no luck or is there anything that we need to do it on the server.

$.ajax({
  cache: false,
  crossDomain: true,
  url: "https://docs.google.com/forms/d/e/1FAIpQLSeqmqeUyQKPR4gncxSiM4rqnQq34h87c9J-XpHK1DF6n9f9_w/formResponse",
  data: {"entry.92445343": firstname, "entry.360980429": lastname, "entry.1982457434": receiptnumber,
  "entry.776257995": storelocator, "entry.1724875707": email, "entry.295248778": phone,
  "entry.2080536869": terms, "entry.764222432": age, "entry.495317103": signup },
  async:false,
  type: "POST",
  dataType: "xml",
      success: function (response) {
             if (response.d == true) {
                  alert("You will now be redirected.");
                  window.location = "//www.aspsnippets.com/";
              }
          },
          failure: function (response) {
              alert(response.d);
          }
  
})

Open in new window


Screen-Shot-2017-11-02-at-11.39.26-A.pngScreen-Shot-2017-11-02-at-11.53.07-A.png
Help appreciated
Jeremy LeysTechnical LeadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
it seems to be a cross-origin resource sharing (CORS) issue.

you got to add the header in your IIS.

SnapShot.png
add the option highlighted above, either to add its value as "*" or "docs.google.com"
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeremy LeysTechnical LeadAuthor Commented:
Thank you, this is a good solution
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Google

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.