Can I submit form info to Google Spreadsheets with jQuery's AJAX?

空扰寡人 提交于 2019-12-04 11:04:45

问题


I like being able to use google spreadsheets, but it's tricky to integrate into my site visually. So I was thinking that I would recreate their form (an easy cut/paste), submit the form via AJAX, the data would go to the spreadsheet and I could redirect my user to something more pretty than google's default 'thank you for doing whatever you just did' page.

But i'm having a lot of trouble submitting the form. I've got my js to the point where the url that the submission goes to (and the get parameters) match exactly what the google form submits (firebug's net tab was very handy here). In fact when I copy the failed submission url from firebug and put that in the browser it goes through no problem.

You're welcome to check it out. http://www.stardustindependent.com/cookies What's the problem here? The relevant JS is in custom.js.


回答1:


Ok, I still don't know what's up with that. I saw some inconclusive reference to google wanting to prevent cross-domain issues, but it wasn't helpful info.

My solution ended up coming from http://googlesystem.blogspot.com/2008/05/customize-google-docs-forms.html. It's not ajax, but it gives you control of the form layout/css and it doesn't redirect you to that nasty looking google page.



来源:https://stackoverflow.com/questions/4351188/can-i-submit-form-info-to-google-spreadsheets-with-jquerys-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!