当前位置:编程学习 > 网站相关 >>

向编辑器插入指定 并设置编辑器中内容

<!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=gb2312" />
<title>向编辑器插入指定 并设置编辑器中内容</title>
<script>
//向编辑器插入指定代码
function inserthtmltoeditor(codestr){
  var oeditor = fckeditorapi.getinstance("content");
  if (oeditor.editmode==fck_editmode_wysiwyg){
    oeditor.inserthtml(codestr);
  }else{
    return false;
  }
}

//设置编辑器中内容
function setcontents(codestr){
  var oeditor = fckeditorapi.getinstance("content") ;
  oeditor.sethtml(codestr) ;
}


</script>
</head>

<body>
</body>
</html>

补充:网页制作,设计基础 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,