Mahesh Karthu Mahesh Karthu - 4 days ago 4x
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);



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');