神呀,救救我吧!我快被它折磨死了。

xiao_yu 2002-07-24 03:25:36
我有这样一段代码:
.....
<div ID="tbContentElement" class="tbContentElement">
<iframe id=target name=target scrolling="yes" marginwidth=1 style="HEIGHT: 100%; WIDTH: 100%">
</iframe>
<br>
</div>
.....
.....
<script>
targetDoc = document.frames.target.document;
targetDoc.designMode = "On";
</script>
......

这样的话,iframe所定议的贞处于可编辑状态,问题是编辑完了以后,我该如何取出编辑的值,我实在没招了,大哥如果有时间,一定要帮帮我呀!

可以的话,给详细一点。多谢了!!!
...全文
33 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiushuiwuhen 2002-07-26
  • 打赏
  • 举报
回复
<div ID="tbContentElement" class="tbContentElement">
<iframe id=target name=target scrolling="yes" marginwidth=1 style="HEIGHT: 90%; WIDTH: 100%">
</iframe>
<br><input type=button value=view
onclick="alert(targetDoc.body.innerHTML);">
<input type=button value=underline
onclick="targetDoc.execCommand('underline');">
<input type=button value=background
onclick="targetDoc.body.bgColor='#336699'">
<input type=button value=image
onclick="target.focus();targetDoc.selection.createRange().pasteHTML('<img src='+picSrc.value+'>')">
<input name=picSrc size=40 value=http://www.csdn.net/images/csdn.gif>
</div>

<script>
targetDoc = document.frames.target.document;
targetDoc.designMode = "On";
</script>
qiushuiwuhen 2002-07-26
  • 打赏
  • 举报
回复
<div ID="tbContentElement" class="tbContentElement">
<iframe id=target name=target scrolling="yes" marginwidth=1 style="HEIGHT: 90%; WIDTH: 100%">
</iframe>
<br><input type=button value=view
onclick="alert(targetDoc.body.innerHTML);">
<input type=button value=underline
onclick="targetDoc.execCommand('underline');">
<input type=button value=background
onclick="targetDoc.body.bgColor='#336699'">
<input type=button value=image
onclick="target.focus();targetDoc.selection.createRange().pasteHTML('<img src='+picSrc.value+'>')">
<input name=picSrc size=40 value=http://www.csdn.net/images/csdn.gif>
</div>

<script>
targetDoc = document.frames.target.document;
targetDoc.designMode = "On";
</script>
xiao_yu 2002-07-26
  • 打赏
  • 举报
回复
我现在想再问一下动态改变所定义的编辑区的背景和如何通过程序插入图片呢??
meizz 2002-07-24
  • 打赏
  • 举报
回复
你用这个试试:document.frames.target.document.body.innerHTML

<div ID="tbContentElement" class="tbContentElement">
<iframe id=target name=target scrolling="yes" marginwidth=1 style="HEIGHT: 90%; WIDTH: 100%">
</iframe>
<br><input type=button value=view
onclick="alert(document.frames.target.document.body.innerHTML);">
</div>

<script>
targetDoc = document.frames.target.document;
targetDoc.designMode = "On";
</script>
meizz 2002-07-24
  • 打赏
  • 举报
回复
你用这个试试:document.frames.target.document.body.innerHTML

<div ID="tbContentElement" class="tbContentElement">
<iframe id=target name=target scrolling="yes" marginwidth=1 style="HEIGHT: 90%; WIDTH: 100%">
</iframe>
<br><input type=button value=view
onclick="alert(document.frames.target.document.body.innerHTML);">
</div>

<script>
targetDoc = document.frames.target.document;
targetDoc.designMode = "On";
</script>
evonne_feng 2002-07-24
  • 打赏
  • 举报
回复
targetDoc.body.innerHTML;

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧