Opened 17 years ago

Closed 17 years ago

#723 closed Bug (invalid)

Passing Javascript to FCK via oFCKeditor.Value

Reported by: Kevin Mack Owned by:
Priority: Normal Milestone:
Component: General Version: FCKeditor 2.4.3
Keywords: Cc:

Description

I am having a lot of difficulty passing javascript to FCK via Value attribute before issuing the Create() command.

For example,

oFCKeditor.Value = "<script type='text/javascript' src='swfobject.js'></script>";

OR

oFCKeditor.Value = '<script type="text/javascript" src="swfobject.js"></script>';

both break version 2.4.3 on IE and FF.

However,

oFCKeditor.Value = "<script src='swfobject.js'>";

works fine, but if you view the source after FCK auto formats the input and try to pass it back to FCK via Value attribute, FCK again breaks. I have tried playing with the FullPage configuration options, as well as ProtectedTags, ProtectedSource, and DOCTYPE. Also, passing the string with single vs. double quotes does seem to matter as long as you remember to escape the correct characters.

Using 2.4.3.

Change History (1)

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

Keywords: script tags removed
Resolution: invalid
Status: newclosed

This is due to the fact that the HTML parser of the browser will see the </script> in the string, but it doesn't understand javascript, it just see a </script> and then closes the script block.

If you try to validate the page you'll see the error. To fix it use <\/script>

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