【问题标题】:ckeditor paste event object not containing pasted datackeditor 粘贴事件对象不包含粘贴的数据
【发布时间】:2017-01-22 00:32:14
【问题描述】:

ckeditor 粘贴事件对象不包含根据 API 文档应有的属性:

http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-paste

我正在获取粘贴事件如下:

CKEDITOR.on('instanceReady', function(ev) {
    alert('Pasted: ' + JSON.stringify(evt));
});

警报返回以下字符串化对象:

{"name":"paste","sender":{"$":{"form_select_standardlanguage": 
{"0":{},"1":{"0":{},"1":{},"2":{},"3":{},"4":{},"5":{},"6":{}},"2":
{"0":{},"1":{}}},"location":{"href":"http://somehost.com
/somefile.php","origin":"http: 
//somehost.com","protocol":"http:","host":"somehost.com", 
"hostname":"somehost.com","port":"","pathname":   
"/somefile.php","search":"?searchkey=somekey","hash":""},
"data-cke-expando":102}},"data":{"$":{"isTrusted":true}}}

我需要的是粘贴的文本来检查它并对其进行更改。

【问题讨论】:

    标签: ckeditor paste


    【解决方案1】:

    您没有处理paste 事件。

    CKEDITOR.on('instanceReady', function(evt) {
        evt.editor.on('paste', function (evt) {
            alert('Pasted: ' + JSON.stringify(evt));
        });
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多