【firefox中,获取焦点时触发特定函数,求解。】 onfocus事件火狐和IE不兼容!好像最新版的ff已经解决了这个问题! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 关键是有没有实现onfocus的变通的办法? <iframe style="border:1px solid #CC99FF" id="WEditor" name="WEditor" height="200" width="397" marginheight="2" marginwidth="2"></iframe><script>var isIE = document.all;var isFF = window.getSelection;if (isIE)//IE{ editor.onfocus = function(){alert("a");}}else if (isFF)//FireFox{ //这里麻烦大大们补一下下}</script> 少了一句 var editor = document.getElementById("WEditor").contentWindow; ff下的iframe没有onfucus事件如果你是做编辑器,可以对iframe中的document添加onclick事件,并且绑定事件时不能使用document.onclick=function(){代码}只能使用document.addEventListener来绑定 <iframe style="border:1px solid #CC99FF" id="WEditor" name="WEditor" height="200" width="397" marginheight="2" marginwidth="2" onfocus="alert('a')" > </iframe> <script> var isIE = document.all; var isFF = window.getSelection; window.onload=function(){var editor=isIE?document.getElementById("WEditor"):document.getElementById("WEditor").contentWindowif (isFF)//FireFox { editor.document.addEventListener("click",function(){alert("a");},false);} }</script> 怎么使img标签下的onclick事件不可用 对象不支持此属性或方法 急!!! <frameset > 打印问题,寻求一个好的方法把frameset 边框去年掉。 关于getElementsByName,很奇怪的问题。 ja代码互相影响导致效果不能实现。分开都可以,放一起就不行。 求一本ExtJS的入门书籍 如何 跨域跳转 传值??? 好象比较困难。src问题 Jquery easyui updateRow后使用getChanges获取不到更改的数据 急!! my97datepicker 时间限制 请问怎么让下拉框可以显示空格? <input type......
<script>
var isIE = document.all;
var isFF = window.getSelection;
if (isIE)//IE
{
editor.onfocus = function(){alert("a");}
}
else if (isFF)//FireFox
{
//这里麻烦大大们补一下下
}
</script>
<script>
var isIE = document.all;
var isFF = window.getSelection;
window.onload=function()
{
var editor=isIE?document.getElementById("WEditor"):document.getElementById("WEditor").contentWindow
if (isFF)//FireFox
{
editor.document.addEventListener("click",function(){alert("a");},false);
}
}
</script>