CKeditor Ajax问题

I was trying to use ckeditor with official jQuery Form Plugin for AJAX based forms but with the first submit I dont get the data. If I submit it for the second time only then it works. Any suggestions on this?

I had a similar issue, and while there were a few different approaches (i.e. event binding), this was the simplest solution I came up with.

$(document).ready(function () {
    $('[type="submit"]').click(function () {
        UpdateCKEditors();
    });
});

/// <summary>
/// Updates the textarea elements of all CKEditor instances.
/// This method is intended to be used onsubmit
/// </summary>
function UpdateCKEditors() {
    for (var i in CKEDITOR.instances) {
        CKEDITOR.instances[i].updateElement();
    }    
}

With a jQuery Form Plugin do:

$(".ajaxForm").ajaxForm({
    beforeSerialize: function(){
        UpdateCKEditors();
    }
});
function UpdateCKEditors() {
    for (var i in CKEDITOR.instances) {
        CKEDITOR.instances[i].updateElement();
    }    
}