Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ( instance in CKEDITOR.instances )
- CKEDITOR.instances[instance].updateElement();
- CKEDITOR.instances["editor1"].on("instanceReady", function()
- {
- //set keyup event
- this.document.on("keyup", CK_jQ);
- //and paste event
- this.document.on("paste", CK_jQ);
- });
- function CK_jQ()
- {
- CKEDITOR.tools.setTimeout( function()
- {
- $("#editor1").val(CKEDITOR.instances.editor1.getData());
- }, 0);
- }
- CKEDITOR.instances["editor1"].document.on('keydown', function(event)
- {
- CKEDITOR.tools.setTimeout( function()
- {
- $("#editor1").val(CKEDITOR.instances.editor1.getData());
- }, 0);
- });
- CKEDITOR.instances["editor1"].document.on('paste', function(event)
- {
- CKEDITOR.tools.setTimeout( function()
- {
- $("#editor1").val(CKEDITOR.instances.editor1.getData());
- }, 0);
- });
- console.log(CKEDITOR.instances.editor1.getData());
- CKEDITOR.instances["editor1"].on("instanceReady", function()
- {
- //set keyup event
- this.document.on("keyup", CK_jQ);
- //and paste event
- this.document.on("paste", CK_jQ);
- }
- function CK_jQ()
- {
- CKEDITOR.instances.editor1.updateElement();
- }
- CKEDITOR.instances.editor1.on('contentDom', function() {
- CKEDITOR.instances.editor1.document.on('keyup', function(event) {/*your instructions*/});
- });
- var editor = CKEDITOR.replace('editor');
- CKEDITOR.instances.editor.on("instanceReady", function(){
- this.on('contentDom', function() {
- this.document.on('keydown', function(event) {
- CKEDITOR.tools.setTimeout( function(){
- $(".seldiv").html(CKEDITOR.instances.editor.getData());
- }, 1);
- });
- });
- this.on('contentDom', function() {
- this.document.on('paste', function(event) {
- CKEDITOR.tools.setTimeout( function(){
- $(".seldiv").html(CKEDITOR.instances.editor.getData());
- }, 1);
- });
- });
- edits_clix();
- var td = setTimeout("ebuttons()", 1);
- })
- <script type="text/javascript">
- var editor = CKEDITOR.replace( 'editor1' );
- editor.on("instanceReady", updateInstance() )
- </script>
- function updateInstance()
- {
- CKEDITOR.instances["editor1"].document.on('keydown', function(event)
- {
- CKEDITOR.tools.setTimeout( function()
- {
- $("#editor1").val(CKEDITOR.instances.editor1.getData());
- }, 0);
- });
- CKEDITOR.instances["editor1"].document.on('paste', function(event)
- {
- CKEDITOR.tools.setTimeout( function()
- {
- $("#editor1").val(CKEDITOR.instances.editor1.getData());
- }, 0);
- });
- }
- $(document).ready(function() {
- $('#form').submit(function(){
- if ( CKEDITOR.instances.editor1.getData() == '' ){
- alert( 'There is no data available' );//an alert just to check if its working
- }else{
- var editor_data = CKEDITOR.instances.editor1.getData();
- $("#editor1").val(editor_data); //at this point i give the value to the textarea
- $.ajax({
- //do your ajax here
- });
- }
- return false;
- });
- });
- if (typeof CKEDITOR !== "undefined") {
- for ( instance in CKEDITOR.instances )
- CKEDITOR.instances[instance].updateElement();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement