摘要: document.onkeydown=keydown;function keydown(event){ if ( !event ) event = window.event; var keycode = event.KeyCode | event.Which; alert(keycode);} 阅读全文
posted @ 2011-01-07 18:09 toxot 阅读(208) 评论(0) 推荐(0) 编辑
摘要: iframe id= "myframe" /iframeW3C的标准告诉我们,可以通过Dom对象的contentDocument属性来返回文档对象。即 doc= document.getElementById('myframe' ).contentDocument但对IE浏览器来说,经过测试,IE6,IE7都不支持,IE8开始支持了。在IE下,需要这样来访问document.frames['myframe'].document;跨浏览器的解决方案是,contentWindow属性,这是个只读属性,返回指定的iframe的窗口对象。它虽然不是标准的一部分,但各个主流浏览器都支持。所以跨浏 阅读全文
posted @ 2011-01-07 17:13 toxot 阅读(307) 评论(0) 推荐(0) 编辑