CKeditor删除符号$ 100

时间:2017-08-07 08:05:44

标签: javascript ckeditor

我有插件CKeditor,当我用“$ 100”写文本时,ckeditor删除这个字符串,当我保存。我怎么能解决这个问题?

JS:

<script type="text/javascript">
    jQuery(document).ready(function () {
        CKEDITOR.config.allowedContent = true;
        CKEDITOR.config.extraPlugins = 'dragresize,jsplus_stat';
        var editorMd = CKEDITOR.replace('edit_md', {contentsCss: '/css/tools.css'});
        var editorRu = CKEDITOR.replace('edit_ru', {contentsCss: '/css/tools.css'});
        var editorEn = CKEDITOR.replace('edit_en', {contentsCss: '/css/tools.css'});
        //CKFinder.SetupCKEditor( null, '/js/ckfinder3/' );
        //CKEDITOR.config.wordcount = {showWordCount: true}
        CKEDITOR.config.filebrowserBrowseUrl = '/js/kcfinder/browse.php?opener=ckeditor&type=files';
        CKEDITOR.config.filebrowserImageBrowseUrl = '/js/kcfinder/browse.php?opener=ckeditor&type=imagesnew';
        CKEDITOR.config.filebrowserFlashBrowseUrl = '/js/kcfinder/browse.php?opener=ckeditor&type=flash';
        CKEDITOR.config.filebrowserUploadUrl = '/js/kcfinder/upload.php?opener=ckeditor&type=files';
        CKEDITOR.config.filebrowserImageUploadUrl = '/js/kcfinder/upload.php?opener=ckeditor&type=imagesnew';
        CKEDITOR.config.filebrowserFlashUploadUrl = '/js/kcfinder/upload.php?opener=ckeditor&type=flash';
        //CKFinder.setupCKEditor(null);
        /*
         CKFinder.setupCKEditor( null, {
         skin: 'moono',
         swatch: 'b',
         onInit: function( finder ) {
         finder.on( 'files:choose', function( evt ) {
         var file = evt.data.files.first();
         //console.log( 'Selected: ' + file.get( 'name' ) );
         } );
         }
         } );
         */
        /*
         CKEDITOR.editorConfig = function(config) {
         config.filebrowserBrowseUrl = '/js/kcfinder/browse.php?opener=ckeditor&type=files';
         config.filebrowserImageBrowseUrl = '/js/kcfinder/browse.php?opener=ckeditor&type=images';
         config.filebrowserFlashBrowseUrl = '/js/kcfinder/browse.php?opener=ckeditor&type=flash';
         config.filebrowserUploadUrl = '/js/kcfinder/upload.php?opener=ckeditor&type=files';
         config.filebrowserImageUploadUrl = '/js/kcfinder/upload.php?opener=ckeditor&type=images';
         config.filebrowserFlashUploadUrl = '/js/kcfinder/upload.php?opener=ckeditor&type=flash';
         };
         */
        jQuery('#date_show').datetimepicker({
            locale: 'en',
            format: 'YYYY-MM-DD HH:mm:ss'
        });
    });
    function openMedia() {
        window.open('<?=$adminRoot . 'news/media/id/' . $item->id . '/'?>', '_blank', 'width=800,height=600');
        return false;
    }
</script>

加载CKeditor时的代码,并配置它。请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

CKEditor是一个JavaScript应用程序。它与保存数据无关。我还没有听说任何内置过滤器删除“$ 100”字符串。你可能要检查的事情:

  1. 运行CKEDITOR.instances.yourEditorInstanceName.getData();。如果不存在“100美元”,请查找对\$\d模式或类似内容做出反应的某些第三方脚本。要检查的另一件事是第三方CKEditor插件。也许你有一些“保存前”插件可以过滤掉这些字符串。
  2. 请检查您的服务器端代码,如果它不包含任何过滤器,请删除以$开头的字符串。调试整个请求(提交编辑器数据时)也可以帮助您找出“$ 100”被删除的位置。