iframe在Firefox中不起作用 [英] iframe do not work in Firefox
本文介绍了iframe在Firefox中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在ASP.net网站上将iframe用作textarea,
但是它不适用于Firefox,因为除非在页面加载中在其中写入一些文本,否则我无法在其中输入指针
那是我的javascript代码,我必须在页面加载时写一些像任何东西"之类的文本才能与firefox一起使用
Hi guys,
I am used iframe as textarea in ASP.net website,
but it do not work with firefox as i cann''t enter the pointer inside it unless i write some text in it in page load
that is my javascript code where i must write some text like "any thing" with page load to work it with firefox
<script type="text/javascript">
function populateIframe(iFrameId, text)
{
var iframe = document.getElementById(iFrameId);
var doc;
if (iframe.contentDocument)
{
doc = iframe.contentDocument;
}
else
{
doc = iframe.contentWindow.document;
}
doc.write(text);
}
var hdhiddenfieldValue = document.getElementById('<%=hdSaveHtml.ClientID %>').value;
if(hdhiddenfieldValue=="")
{
hdhiddenfieldValue = "any thing";
}
populateIframe('wysiwyg', hdhiddenfieldValue);
</script>
推荐答案
使用& nbsp;而不是空格
use instead of space
这篇关于iframe在Firefox中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文