<body>
<iframe id="input"   src="about:blank" allowtransparency="true"  frameborder="0"  marginwidth="0" marginheight="0" width="100%" height="113px"></iframe> </body>js:if(window.attachEvent)//IE:如果浏览器中存在window.attachEvent函数则使用window.attachEvent函数,判断是否是IE还可以使用:if (document.all){//..}
window.attachEvent("onload",function (){edit();});function edit() { var ifr = frames[0]; ifr.document.designMode = 'on';
ifr.document.addEventListener("keydown", function() {
fireKeyDown();
}, true);
}
function fireKeyDown() {
alert("FF");
}
在FF浏览器中,按下键盘的任何一个按键,可以弹出提示,但是用
function fireKeyDown() {
var ifr = frames[0];
switch(ifr.event.keyCode){
            case 13:
alert("FF");
break;}
这样写就没有提示,ifr.event在FF下是为空的,将ifr.event换成ifr.which或charCode也还是不行 ,为什么按键信息都捕捉到了,按键码却判断不出来,IE跟GOOGLE下面是好的,火狐就不行