Opened 17 years ago

Last modified 12 years ago

#325 closed Bug

API: GetXHTML() temporarily distorts rendering — at Version 2

Reported by: Brian Klug Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.4.2
Keywords: Cc:

Description (last modified by Alfonso Martínez de Lizarrondo)

Steps to reproduce:

  1. Load demo page with Firefox
  2. Choose "Sample 8: Editor API usage" from the drop down
  3. Focus before "You are using" and hit enter 5 times
  4. Click "Get Editor Contents (XHTML)"

The call returns the proper XHTML, but the text in the editor jumps.

We are implementing an autosave feature which periodically calls this function to get the XHTML and send it back to the server using XMLHTTPRequest. It works perfectly except for the dancing text ;)

Change History (2)

comment:1 Changed 17 years ago by Brian Klug

For anyone else having this problem, I recommend using the following workaround:

var fck = FCKeditorAPI.GetInstance('content');
var xhtml = fck.EditorDocument.body.innerHTML;

comment:2 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Description: modified (diff)
Keywords: Confirmed added; API removed

If you get the contents with body.innerHTML then you'll have very serious trouble when the content has any protected source element (comments, script) that will get lost, in links and anchors you'll get extra attributes, in flash, anchors and other special elements you'll get the fake image instead of the contents...

So that would be a really bad workaround as a general rule.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy