兴国资源网 Design By www.nnzcdc.com
复制代码 代码如下:
function abc()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
alert(checkContent.GetXHTML());//获取当前内容
var newelement = document.createElement("a");
newelement.href="#";
newelement.innerHTML="df";
checkContent.InsertElement(newelement);//前部添加元素(无返回值)
var a=checkContent.InsertElementAndGetIt(newelement);//前部添加元素(返回元素)
checkContent.InsertHtml("")//添加html
checkContent.SetHTML("",true);//设置内容,后为bool,是否所见即所得
}
function aaa()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
checkContent.SwitchEditMode();//转变编辑模式
checkContent.UpdateLinkedField();//更新关联文件
}
function FCKeditor_OnComplete( checkContent )//当加载完
{
alert( checkContent.Name ) ;
}
//设置fckeditor为只读
function FCKeditor_OnComplete(editorInstance)
{
editorInstance.EditorDocument.body.disabled = true;
editorInstance.EditorWindow.parent.document.getElementById ('xExpanded').style.display = 'none';
editorInstance.EditorWindow.parent.document.getElementById('xCollapsed').style.display = 'none';
editorInstance.EditorWindow.blur();
}
//向编辑器插入指定代码
function insertHTMLToEditor(codeStr){
var oEditor = FCKeditorAPI.GetInstance("content");
if (oEditor.EditMode==FCK_EDITMODE_WYSIWYG){
oEditor.InsertHtml(codeStr);
}else{
return false;
}
}
//统计编辑器中内容的字数
function getLength(){
var oEditor = FCKeditorAPI.GetInstance("content");
var oDOM = oEditor.EditorDocument;
var iLength ;
if(document.all){
iLength = oDOM.body.innerText.length;
}else{
var r = oDOM.createRange();
r.selectNodeContents(oDOM.body);
iLength = r.toString().length;
}
alert(iLength);
}
//执行指定动作
function ExecuteCommand(commandName){
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.Commands.GetCommand(commandName).Execute() ;
}
//设置编辑器中内容
function SetContents(codeStr){
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.SetHTML(codeStr) ;
}
//使用FCKEditor时使用js在光标处添加任意字符串
function InsertHTML(e,inStr)//e:FCKEditor的ID,inStr:要插入的信息
{
var oEditor = FCKeditorAPI.GetInstance(e) ;
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
{
oEditor.InsertHtml( inStr ) ;
}
else
alert("You must be on WYSIWYG mode!" ) ;
}
function ExecuteCommand( commandName,e )
{
var oEditor = FCKeditorAPI.GetInstance(e) ;
oEditor.Commands.GetCommand(commandName ).Execute() ;
}
function abc()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
alert(checkContent.GetXHTML());//获取当前内容
var newelement = document.createElement("a");
newelement.href="#";
newelement.innerHTML="df";
checkContent.InsertElement(newelement);//前部添加元素(无返回值)
var a=checkContent.InsertElementAndGetIt(newelement);//前部添加元素(返回元素)
checkContent.InsertHtml("")//添加html
checkContent.SetHTML("",true);//设置内容,后为bool,是否所见即所得
}
function aaa()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
checkContent.SwitchEditMode();//转变编辑模式
checkContent.UpdateLinkedField();//更新关联文件
}
function FCKeditor_OnComplete( checkContent )//当加载完
{
alert( checkContent.Name ) ;
}
//设置fckeditor为只读
function FCKeditor_OnComplete(editorInstance)
{
editorInstance.EditorDocument.body.disabled = true;
editorInstance.EditorWindow.parent.document.getElementById ('xExpanded').style.display = 'none';
editorInstance.EditorWindow.parent.document.getElementById('xCollapsed').style.display = 'none';
editorInstance.EditorWindow.blur();
}
//向编辑器插入指定代码
function insertHTMLToEditor(codeStr){
var oEditor = FCKeditorAPI.GetInstance("content");
if (oEditor.EditMode==FCK_EDITMODE_WYSIWYG){
oEditor.InsertHtml(codeStr);
}else{
return false;
}
}
//统计编辑器中内容的字数
function getLength(){
var oEditor = FCKeditorAPI.GetInstance("content");
var oDOM = oEditor.EditorDocument;
var iLength ;
if(document.all){
iLength = oDOM.body.innerText.length;
}else{
var r = oDOM.createRange();
r.selectNodeContents(oDOM.body);
iLength = r.toString().length;
}
alert(iLength);
}
//执行指定动作
function ExecuteCommand(commandName){
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.Commands.GetCommand(commandName).Execute() ;
}
//设置编辑器中内容
function SetContents(codeStr){
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.SetHTML(codeStr) ;
}
//使用FCKEditor时使用js在光标处添加任意字符串
function InsertHTML(e,inStr)//e:FCKEditor的ID,inStr:要插入的信息
{
var oEditor = FCKeditorAPI.GetInstance(e) ;
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
{
oEditor.InsertHtml( inStr ) ;
}
else
alert("You must be on WYSIWYG mode!" ) ;
}
function ExecuteCommand( commandName,e )
{
var oEditor = FCKeditorAPI.GetInstance(e) ;
oEditor.Commands.GetCommand(commandName ).Execute() ;
}
兴国资源网 Design By www.nnzcdc.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
兴国资源网 Design By www.nnzcdc.com
暂无评论...
更新日志
2024年09月27日
2024年09月27日
- 纯音入心系列纯音乐《中央民族乐团-古筝传奇》1CD[MP3][253.1MB]
- 江玲.1989-这样你才爱我,是吗?【新作有声】【WAV+CUE】
- 郭美美.2010-我是郭美美【华纳】【WAV+CUE】
- 黄心懋1991-轻忧郁【滚石】【WAV+CUE】
- 群星.2000-大地金曲世纪回顾2CD【大地】【WAV+CUE】
- 王菲.1996-浮躁(2024环球MQA-UHQCD限量版)【环球】【WAV+CUE】
- 群星.2022-传家电视剧原声带【东阳欢娱】【FLAC分轨】
- 《摇滚教父 伍佰黄金精选 2CD》 [WAV+CUE][1GB]
- 《凤凰传奇 我从草原来》[WAV/分轨][400MB]
- 《叶倩文 真心真意过一生》[WAV+CUE][400MB]
- 潘越云.1985-世间女子(滚石25周年经典复刻版)【滚石】【WAV+CUE】
- 陈柏宇.2009-CANT.BE.HALF【SONY】【WAV+CUE】
- 李明依.1989-小女生【滚石】【WAV+CUE】
- 《李荣浩 新时代创作新人王》[WAV分轨][310MB]
- 《黑鸭子与马头琴 史上最动听草原音乐》[WAV+CUE][320MB]