Firefox中的IFRAME问题 [英] IFRAME Problem in firefox

查看:66
本文介绍了Firefox中的IFRAME问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用IFRAME创建了一个文本区域。问题是它只能在Internet Explorer中使用,而不能在Mozilla Firefox中使用。请帮我解决这个问题。有没有在IE和Firefox上运行的特殊命令或标签?在此先感谢....代码如下:
< HTML>

< Head>

< Title>简单的HTML演示区域< / title>

<脚本语言=" JavaScript">

函数doBold()

{

frameEdit.document.execCommand(''bold'',false,null);

}

函数doItalic()

{

frameEdit.document.execCommand(''italic'',false,null);

}

函数标题()

{

frameEdit.document.execCommand(''FormatBlock'',false,''< H1>'');

}

< / Script>

< / Head>

< Body onLoad =" frameEdit.document.designMode =''on''; ">

< form id =" frmEdit">

< IFRAME id =" frameEdit"风格= QUOT;宽度:600px的;高度:300像素" align = center>

< / IFRAME>

< br>

< P align = center>

<输入类型="按钮"值= QUOT;粗体" onClick =" doBold()">

<输入类型="按钮"值= QUOT;斜体" onClick =" doItalic()">

<输入类型="按钮"值= QUOT; H1" onClick ="标题()">

< / P>


< / form>

< / Body>

< / HTML>

I have created a text area using IFRAME. The problem is that it is working only in Internet Explorer not in Mozilla Firefox. Please help me regarding this problem. IS there any special command or tag which runs on both IE and firefox? Thanks in advance.... Code is below:
<HTML>
<Head>
<Title>Simple Demo of HTML Area </Title>
<Script Language="JavaScript">
function doBold()
{
frameEdit.document.execCommand(''bold'', false, null);
}
function doItalic()
{
frameEdit.document.execCommand(''italic'', false, null);
}
function Heading()
{
frameEdit.document.execCommand(''FormatBlock'', false,''<H1>'');
}
</Script>
</Head>
<Body onLoad="frameEdit.document.designMode=''on'';">
<form id="frmEdit">
<IFRAME id="frameEdit" style="width:600px; height:300px" align=center>
</IFRAME>
<br>
<P align=center>
<Input type="Button" value="Bold" onClick="doBold()">
<Input type="Button" value="Italic" onClick="doItalic()">
<Input type="Button" value="H1" onClick="Heading()">
</P>


</form>
</Body>
</HTML>

推荐答案

这是HTML论坛,这是一个Javascript问题?
This is the HTML forum is this a Javascript problem?



这是HTML论坛这是一个Javascript问题吗?
This is the HTML forum is this a Javascript problem?



好​​了忽略javascript并在删除按钮及其功能后看到HTML Body

Well Ignore javascript and just see the HTML Body after removing the buttons and their functuions



嗯忽略javascript,只需在删除按钮及其功能后看到HTML Body
Well Ignore javascript and just see the HTML Body after removing the buttons and their functuions



除了你的HTML之外,我没有看到任何错误将XHTML与HTML混合,你应该坚持使用其中一个。我也不太清楚问题是什么。


Aric

I don''t see anything wrong with the HTML except your mixing XHTML with HTML you should stick with one or the other. I''m also not really clear what the problem is.

Aric


这篇关于Firefox中的IFRAME问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆