键盘事件绑定:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
< html >
< head >
< base  href="<%=basePath%>">
< title >Insert title here</ title >
< script  type = "text/javascript"  src="<%=basePath %>ckk/ckeditor/ckeditor.js"></ script >
</ head >
< body >
< form  action = ""  method = "post" >
     < textarea  class = "ckeditor"  name = "context"  id = "context" ></ textarea >
     < input    type = "button"  value = "提交"  onclick = "test()" />
</ form >
< div  id = "info" ></ div >
${param.context }
< script  type = "text/javascript" >
      //键盘事件绑定
      var editor = CKEDITOR.replace('context');
      CKEDITOR.instances["context"].on("key",  function(evt){
             document.getElementById("info").innerHTML =editor.getData();
      });
</ script >
</ body >
</ html >