How to Post Google Forms Data via jQuery and Ajax to Spreadsheets

前端 未结 1 1195
渐次进展
渐次进展 2020-12-30 15:08

I\'m working on a Chrome extension that\'s essentially a simple custom Google Form that will post to a response Spreadsheet. I got the following function to successfully sen

相关标签:
1条回答
  • 2020-12-30 15:51

    This is the way I did it... http://jsfiddle.net/adutu/7towwv55/1/ You can see that you receive a CORS error but it works... the data gets where it should be

            function postToGoogle() {
                var field3 = $('#feed').val();
    
                $.ajax({
                url: "https://docs.google.com/forms/d/[key]/formResponse",
                data: {"entry.347455363": field3},
                type: "POST",
                dataType: "xml",
                statusCode: {
                    0: function() {
                        //Success message
                    },
                    200: function() {
                        //Success Message
                    }
                }
            });
            }
    

    See more info here

    0 讨论(0)
提交回复
热议问题