Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

No Access control allow origin issue - Jquery

Avatar of Jeremy Leys
Jeremy LeysFlag for New Zealand asked on
jQueryGoogle
2 Comments1 Solution138 ViewsLast Modified:
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);
          }
  
})

Screen-Shot-2017-11-02-at-11.39.26-A.pngScreen-Shot-2017-11-02-at-11.53.07-A.png
Help appreciated
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers