将带有远程内容的 iframe 附加到 dojo 容器
我对 dojo 很陌生,想知道如何在 dojo 容器中拥有 iframe - 内容窗格或 borderContainer (我不需要访问 iframe 中的任何内容,也不需要通过 ajax 加载它- 只需将其放入我的应用程序中的内容窗格中即可。如果我可以以某种方式绕过 dojo 尝试加载的内容,我认为这可能会以某种方式导致解决方案,但我似乎无法找到解决方案。直接加载内容窗格当然,因为通过ajax加载引入了跨域考虑因素,我尝试过:
- 使用内容和内容字符串
''
- dojo.create指定 url
- 使用 dojo.iframe.send 并使用 dojo.io.script.get
- 来创建 iframe 元素,
而 iframe.send 似乎确实返回数据(它看起来像一个有效的页面返回),我不知道如何设置 iframe 的内容。
I'm pretty new to dojo and was wondering how I could have an iframe within a dojo container - either a content pane or a borderContainer (I don't need to access anything in the iframe and don't need to load it via ajax - just plop it into a content pane in my application. If I could somehow bypass having dojo try to load stuff I think that might somehow lead to a solution. I've tried POJS (plain old javascript) and I can't seem to load the content pane directly because of the cross domain considerations introduced by loading via ajax of course. I've tried:
- using the content and a content string
'<iframe id="a" name="a" src="http://google.com"></iframe>'
- using dojo.iframe.send with specifying the url
- using dojo.io.script.get
- dojo.create to create the iframe element
While the iframe.send did seem to return data (it looked like a valid page return), I didn't know how set the content for the iframe. Any pointers would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许我误解了你的意思,但是将 ContentPane 的内容设置为 iframe 应该不是问题。
示例: http://jsfiddle.net/froden/8NemY/
Maybe I misunderstand you, but setting the content of a ContentPane to be an iframe shouldn't be a problem.
Example: http://jsfiddle.net/froden/8NemY/