First time here? Check out the FAQ!
![]() | 1 | initial version | |
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( [^>]*)?="">/gi, ''); }); }); </script>
Thanks
![]() | 2 | No.2 Revision |
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( Thanks