scripting a google docs form submission

前端 未结 7 1633
时光说笑
时光说笑 2020-12-04 15:46

I\'m trying to create a bookmarklet that parses a page and sends the results to a googledocs spreadsheet via a form that I\'ve defined.

The relevent bit of the scrip

相关标签:
7条回答
  • 2020-12-04 16:53

    if your already using jquery, try submitting the form via ajax ($.ajax). You can setup a success function that will be called when google sends back their response.

    alternatively you should be able to use firebug to view the response google sends back.

    Specifically I was thinking you could try something like the following:

    $.ajax({
      url: "http://spreadsheets.google.com/formResponse",
      data: { formkey: "Fd0SHgwQ3YwSFd5UHZpM1QxMlNOdlE6MA&ifq", "entry.0.single": orderDate, "entry.2.single": email, "entry.3.single": customerID },
      type: "POST",
      dataType: "xml",
      success: function(data, textStatus, XMLHttpRequest) {
        console.log("success");
        console.log(data);
      },
      error: function(XMLHttpRequest, textStatus, errorThrown) {
        console.log("error");
        console.log(textStatus);
      },
    })
    
    0 讨论(0)
提交回复
热议问题