开发者

jquery .load() google docs form

i have a form created via google docs like https://spreadsheets.google.com/spreadsheet/embeddedform?formkey=dFgwMWhsallRZ2ViMWNaSVF1VmF2d0E6MQ.

is it possible to load this page into a div with jquery:

var content='https://spreadsheets.google.com/spreadsheet/embeddedform?formkey=dFgwMWhsallRZ2ViMWNaSVF1VmF2d0E6MQ';

$('#some_elem').loa开发者_C百科d(content);

update: #some_elem is a dynamically created element.


This will not work because of the same origin policy. Which basically means you cannot load content from site1.com on site2.com via ajax for security reasons, this behaviour is built into modern browsers so there is no easy way around it unless you control both requesting and requested content. Your best bet is to use an iframe to get around this.


I'm not aware of Google Doc's form creation, what scripts it's possible to use there, etc but it should work, as long as they are on the same domain. But why don't you just try it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜