我如何... Chrome中的html编辑器扩展程序问题 [英] How do I...html editor extender problem in chrome

查看:92
本文介绍了我如何... Chrome中的html编辑器扩展程序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果使用html编辑器扩展器

解决方案

< pre lang =   cs>& lt; script& gt; 


(文件).ready(function(){
if (Sys.Extended& amp; amp; amp; Sys.Extended.UI& amp;& amp; & Sys.Extended.UI.HtmlEditorExtenderBehavior& amp; amp; amp; Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype& amp; amp; amp; amp; Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit){
Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit = function(){
// html encode
var char = 3 ;
var sel = null ;

setTimeout(function(){
if this 。 _editableDiv!= null
._ editableDiv.focus();
} , 0 );
if (Sys.Browser.agent!= Sys.Browser.Firefox){
if (document.selection){
sel = document.selection.createRange();
sel.moveStart(' character');
sel。 select ();
}
其他 {
如果 this ._ editableDiv.firstChild!= null & amp;& amp; this ._ editableDiv.firstChild!= undefined){
sel = window.getSelection();
sel.collapse( this ._ editableDiv.firstChild, char );
}
}
}

// 编码html标签
._ textbox._element。 value = ._ encodeHtml();
}
}
});
& lt; / script& gt; < / pre >


Select index change event not fire in chrome if using html editor extender

解决方案

<pre lang="cs">&lt;script&gt;


(document).ready(function () { if (Sys.Extended &amp;&amp; Sys.Extended.UI &amp;&amp; Sys.Extended.UI.HtmlEditorExtenderBehavior &amp;&amp; Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype &amp;&amp; Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit) { Sys.Extended.UI.HtmlEditorExtenderBehavior.prototype._editableDiv_submit = function () { //html encode var char = 3; var sel = null; setTimeout(function () { if (this._editableDiv != null) this._editableDiv.focus(); }, 0); if (Sys.Browser.agent != Sys.Browser.Firefox) { if (document.selection) { sel = document.selection.createRange(); sel.moveStart('character', char); sel.select(); } else { if (this._editableDiv.firstChild != null &amp;&amp; this._editableDiv.firstChild != undefined) { sel = window.getSelection(); sel.collapse(this._editableDiv.firstChild, char); } } } //Encode html tags this._textbox._element.value = this._encodeHtml(); } } }); &lt;/script&gt;</pre>


这篇关于我如何... Chrome中的html编辑器扩展程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆