您的位置:首页 > 编程语言

测试一下csdn的代码显示功能

2009-10-01 23:41 471 查看
/**
* @author admin
*/
function MouseDown(nsEvent){
var theEvent = nsEvent ? nsEvent : window.event;
var locString = "x = " + theEvent.screenX + "/ny = " + theEvent.screenY;
var clientString = "x = " + theEvent.clientX + "/ny = " + theEvent.clientY;
var eventType = theEvent.type;
document.writeln(locString + "<br />");   //这句如果写到第七行之前,第七行就不能用了
document.writeln(clientString + "<br />");
document.writeln(location + "<br />");
document.writeln(eventType + "<br />");
// document.writeln(window.event.type + "<br />");
// document.writeln(theEvent.type + "<br />");  //这样写firefox可以通过,但是IE就不行,提示permission denyed
}

function KeyDown(nsEvent) {
var theEvent = nsEvent ? nsEvent : window.event;
var keyValue = theEvent.keyCode;
document.writeln("You press the key value of:" + keyValue + "<br />");
document.writeln(theEvent.type + "<br />");
}
document.onmousedown = MouseDown;
document.onkeydown = KeyDown;


 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  测试 firefox function ie