title: Ckeditor update textarea
body: <p>I am trying to get the ckeditor working. Obviously it doesn't make use of the textarea so on submit the form doesn't submit the text in the editor. Beceause I make use of polymorphic associations etc. I can't make a onsubmit function to get the value of the textarea (when the form is submitted) . </p>
  
  <p>So I found this question: <a href="https://stackoverflow.com/questions/924145/using-jquery-to-grab-the-content-from-ckeditors-iframe">Using jQuery to grab the content from CKEditor&#39;s iframe</a></p>
  
  <p>with some very good answers. The answers posted there keep the textarea up to date. That is very nice and just what I need! Unfortunately I can't get it to work.
  Does somebody know why (for example) this doesn't work?</p>
  
  <p>I have a textarea (rails but it just translates to a normal textarea):<br/>
  <code>
  &lt;%= f.text_area :body, :id => 'ckeditor', :rows => 3 %></code></p>
  
  <p>And the following js:<br/></p>
  
  <pre class="lang-js prettyprint-override"><code>if(CKEDITOR.instances.ckeditor ) {
    CKEDITOR.remove(CKEDITOR.instances.ckeditor);
  }
  CKEDITOR.replace( 'ckeditor',
  {
  skin : 'kama',
  toolbar :[['Styles', 'Format', '-', 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', 'Link']]});
  
  
  CKEDITOR.instances["ckeditor"].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.ckeditor.updateElement(); 
  }
  </code></pre>
  
  <p>I get the following "error" in my firebug. <br/>
  <code>
  missing ) after argument list
  [Break on this error] function CK_jQ()\n
  </code></p>