HTMLAREA 3.0使用以及调用
调用方法:
将整个htmlArea解压到需要修改的html文件的同级目录下的htmlarea目录下。
<head>和</head>之间加入:
代码:
<
style
type
="text/css"
>
at import url(htmlarea/htmlarea dot css);
</ style >
< script type ="text/javascript" >
_editor_url = " htmlarea " ; // omit the final slash
</ script >
<!-- load the main HTMLArea files -->
< script type ="text/javascript" src ="htmlarea/htmlarea.js" ></ script >
< script type ="text/javascript" src ="htmlarea/lang/gb.js" ></ script >
< script type ="text/javascript" src ="htmlarea/dialog.js" ></ script >
< script type ="text/javascript" src ="htmlarea/popupwin.js" ></ script >
< script type ="text/javascript" >
var editor = null ;
function initEditor(){
editor = new HTMLArea( " textareaname " );
editor.generate();
return false ;
}
</ script >
然后将<body>改为
at import url(htmlarea/htmlarea dot css);
</ style >
< script type ="text/javascript" >
_editor_url = " htmlarea " ; // omit the final slash
</ script >
<!-- load the main HTMLArea files -->
< script type ="text/javascript" src ="htmlarea/htmlarea.js" ></ script >
< script type ="text/javascript" src ="htmlarea/lang/gb.js" ></ script >
< script type ="text/javascript" src ="htmlarea/dialog.js" ></ script >
< script type ="text/javascript" src ="htmlarea/popupwin.js" ></ script >
< script type ="text/javascript" >
var editor = null ;
function initEditor(){
editor = new HTMLArea( " textareaname " );
editor.generate();
return false ;
}
</ script >
代码:
调用的时候使用
记得上面的name必须和上面script中制定的new HTMLArea("xx")里面的东西一样!另外 style="width:1000%"也必须有
如果使用jsp的c:out那么记得加入escapXml即可