$("#sentBox").keydown(function(e) {
var keycode = e.keyCode || e.which;
if (e.ctrlKey && keycode == 13) {
var content = $(this).val();
if (content == "") {
pop.msg("不能发送空消息");
return;
}
var msg = {
code: 20001,
data: {
fromuid: self.uid,
touid: self.touid,
msg: content,
time: new Date().Format('yyyy-mm-dd hh:ii:ss')
}
};
console.log(msg);
send(msg);
self.appendMessage(self, msg.data);
codeFunction.appendMessage(self.touid, msg.data);
$(this).val('');
}
});
js中绑定键盘事件
猜你喜欢
转载自boyp.iteye.com/blog/2338824
今日推荐
周排行