1,监听textarea的onkeydown事件
复制代码 代码如下:
2, 发送表单,然后重新加载opener窗口(见4,)function sbfrm() {var contenthf=document.getelementbyid(contenthf);var txtar = contenthf.getelementsbytagname(textarea)[0];if (txtar.innerhtml == ) {txtar.focus();return false;}contenthf.submit();window.opener.afterreload();return false;}
3,当ctrl键被按下,并且,keycode为13(回车),时,调用发送表单的函数。
function keysend(event) {if (event.ctrlkey && event.keycode == 13) {sbfrm();}}
4,如果是window.open()方式打开的当前页面,则在window.open的这个页面加入重新加载函数
function afterreload() {settimeout(function () {window.location.reload();}, 1000);}