autosave to mysql DB with Jquery using Ckeditor

autosave to mysql DB with Jquery using Ckeditor

Hi Everyone,
Not sure where i was meant to post this but i thought this area was the best for it.
Just having one issue and is probably a simple fix. I am using the ckeditor in a form that push the content to a mysql database using php. I am also using a jquery function that autosaves using ajax every 20 secs. the autosave function put all the content into the DB except for the textarea that has the ckeditor applied to it. If i submit the the form by pressing the sumbit button everything works how it should, the problem only occurs when the javascript tries to do the saving for me. Heres the javascript code:


  1. <script type="text/javascript">
       $(
    document).ready(function(){         
          
    autosave();
       });
       
       function 


    autosave() 

        var 

    setTimeout("autosave()"20000); 
        var 
    title = $("#txt_title").val(); 
        var 
    text = $("#txt_content").val();
        var 
    author = $("#txt_author").val();
        var 
    issue = $("#txt_issue").val();
        var 
    category = $("#txt_category").val();
        var 
    date = $("#txt_date").val();
        var 
    image = $("#txt_image").val(); 

        if (

    title.length || content.length 0
        { 
            $.

    ajax
            { 
                

    type"POST"
                
    url"autosave.php"
                
    data"id=" + <?php echo $article_id ?> 
    + "&title=" + title + "&text=" + text + "&author=" + author + "&issue=" + issue + "&category=" + category + "&date=" + date + "&imageURL=" + image, 
                cache: false, 
                success: function(message) 
                { 
                    $("#timestamp").empty().append(message); 
                } 
            }); 
        } 
    }
       </script>   









And here is the code on the textarea:
  1. <textarea class="ckeditor" name="text" id="txt_content" cols="50" rows="5"></textarea>
I had this working with tinyMCE but i would prefer to use ckeditor as it works better with the system im making. Any help would be great.
Thanks
Nick