Revision history [back]

click to hide/show revision 1
initial version

asked 2013-08-02 18:16:55 +0800

A100 gravatar image A100

Listener for CKEditor

I need to know how to make a event listener for CKEditor so that when I paste in content it strips out any images. I found this code on the web but don't know how to hook up the editor to this js function

<script type="text/javascript"> CKEDITOR.on('instanceReady', function (ev) { ev.editor.on('paste', function (ev) { ev.data.html = ev.data.html.replace(/<img( [^&gt;]*)?="">/gi, ''); }); }); </script>

Thanks

Listener for CKEditor

I need to know how to make a event listener for CKEditor so that when I paste in content it strips out any images. I found this code on the web but don't know how to hook up the editor to this js function

 <script type="text/javascript">
     CKEDITOR.on('instanceReady', function (ev) {
     ev.editor.on('paste', function (ev) {
     ev.data.html = ev.data.html.replace(/<img( [^&gt;]*)?="">/gi, [^>]*)?>/gi, '');
     });
   });
 </script>

</script>

Thanks

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More