我有一个通过Google文档创建的表单,例如https://spreadsheets.google.com/spreadsheet/embeddedform?formkey=dFgwMWhsallRZ2ViMWNaSVF1VmF2d0E6MQ。
是否可以使用jquery将此页面加载到div中? var content ='https://spreadsheets.google.com/spreadsheet/embeddedform?formkey = dFgwMWhsallRZ2ViMWNaSVF1VmF2d0E6MQ'; $('#some_elem')。load(content);
PS:#some_elem是动态创建的元素。
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?
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.