随笔-60  评论-35  文章-15  trackbacks-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>改为
代码:
<body onload="initEditor()"> 


调用的时候使用
<html:textarea styleId="textareaname"  property="textareaname" rows="20" style="width:100%" /> 

记得上面的name必须和上面script中制定的new HTMLArea("xx")里面的东西一样!另外 style="width:1000%"也必须有

如果使用jsp的c:out那么记得加入escapXml即可
<c:out value="${requestScope.NewsInfo.memo}"  escapeXml="false"/>
posted on 2006-10-21 22:55 Q系列类、方法、变量…… 阅读(2970) 评论(3)  编辑  收藏

评论:
# re: HTMLAREA 3.0使用以及调用 2007-09-04 17:17 | adf
adf  回复  更多评论
  
# re: HTMLAREA 3.0使用以及调用 2008-06-02 11:46 | 周西
不行!按照你的方式,在HTML中就是不行!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ABC_TOUR_REG_FORM</title>
<link href="templates/default/images/style.css" rel="stylesheet" type="text/css">

<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("companyintro");

editor.generate();
return false;
}
</script>

</head>

<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onload="initEditor()">




---------------
FORM表单里
<textarea styleId="companyintro" property="companyintro" cols="70" rows="10" style="width:100%"></textarea>
  回复  更多评论
  
# re: HTMLAREA 3.0使用以及调用 2008-06-06 23:04 | 3wdotec
路过。。。  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: