keyCode === 13(回车)
/**
* 使用ENTER发送消息
*/
document.onkeydown = function () {
var e = window.event || arguments.callee.caller.arguments[0];
e.keyCode === 13 && send();
};
function send(){
...
}
keyCode === 13(回车)
/**
* 使用ENTER发送消息
*/
document.onkeydown = function () {
var e = window.event || arguments.callee.caller.arguments[0];
e.keyCode === 13 && send();
};
function send(){
...
}