javascript - Summernote event for switch from code view to editor -


i use google caja html sanitizer prevent script executions on client side. need put event on switch code view editor, , in event clean html. since there no event switch wrote this:

$('#newfeaturesview .note-editor .btn-codeview').click(function () {         if (!$(element).hasclass('active'))         {             var html = $('#summernote').summernote('code');             var sanitizedhtml = html_sanitize(html, urltransformer, classidtransformer);             $('#summernote').summernote('code', sanitizedhtml);         } }); 

but if html dirty , contains example script alert, alert executed before html cleaned , pasted html editor. how force function clean trigger first?


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -