他们有什么方法可以在不使用 src 的情况下将内容放入 IFRAME 中吗?

发布于 2024-10-01 07:34:53 字数 341 浏览 0 评论 0 原文

我创建了一个自定义 WYSIWYG 编辑器来编辑 XML 文件。我为此使用了

<iframe id="textbox"  style="width:300px; height:150px" >
     <?php echo $content ?>
</iframe>

他们有任何 javascript 代码吗?提前致谢。

I have created a custom WYSIWYG editor for editing an XML file. I have used an <iframe> for this.
I have parsed the XML file and all the contents in a variable. How can I place this content in the <iframe>?
I tried this code but it is not working:

<iframe id="textbox"  style="width:300px; height:150px" >
     <?php echo $content ?>
</iframe>

Is their any javascript code for this.Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夕嗳→ 2024-10-08 07:34:53

不可以。根据 W3C

No. According to the W3C, the content of an <iframe> is only displayed by browsers that don't support frames.
There's a simple solution though: Every other element will work for you. Consider using a simple <div>.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文