Mahesh Karthu Mahesh Karthu - 1 year ago 131
Ajax Question

CORS issue while submitting data to google forms in angular

While submitting the data :
Error Message : XMLHttpRequest cannot load Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8090' is therefore not allowed access. The response had HTTP status code 405.

$scope.postDataToGoogle = function(){
method: 'POST',
crossDomain: true,
url: '',
// dataType: "xml",
data: tempData,

}).error(function(data,status) {
console.log('Error:' + status);


Answer Source

I do have tried with angular still not able solve it, but with jQuery its works for me.

            url: '',
            data: tempData,
            type: "POST",
            dataType: "xml",
            statusCode: {
                0: function () {

                200: function () {
                    alert('Thank you for your valuable feedback');

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download