Does anyone run in Sitecore by removing JavaScript from the page editor?

I am working on a custom page in Sitecore during the holidays, and I noticed a problem when Sitecore removes JavaScript lines from the editor.

Here is an overview of my current scenario:

  • I am adding Javascript to the page.
  • I save, register and publish.
  • The changes are there, and everything works.
  • I am working on this later and these changes no longer exist.

I am the only one who edited this page and publishes the current / correct version. It doesn't matter if I add the script through the "Editor" or "Edit HTML" functions of the content editor. However, it removes JavaScript; all my other changes are intact.

Is there something I am missing in the implementation of Sitecore for JavaScript? I'm not sure what else needs to be done to diagnose it, so I was hoping someone would have an explanation here.

+6
source share
2 answers

Removing script tags in RTE in Sitecore is standard behavior when saving an element. However, in Sitecore 6.4.1 rev. 120113 and Sitecore 6.5 Update-4, a new property has been added to the web.config file:

<setting name="HtmlEditor.RemoveScripts" value="true"/> 

Setting this value to false should solve your problem. If you are using an older version of Sitecore, check out this blogpost for a workaround for older versions.

+14
source

Are you adding this javascript to the Rich Text Editor?

I saw the rich text editor highlight javascript as it saves. Usually we add javascript blocks as a separate sublanguage, which is pulled from a multi-line text field and rendered directly, rather than editing javascript through a rich text editor.

+3
source

All Articles