Javascript being scrubbed from content when using Aloha

  • Updated

When using Aloha, embedded JavaScript is being stripped out. This happens even if tags and attributes are accounted for in the AlohaEktron.aspx whitelist. (Note: The whitelist applies to versions 8.6 & 8.7; it was relaxed in 9.x.)

We are trying to separate content from logic within the editor architecture for a few reasons.

  • Security
  • The use of content in tiered environments
  • General content re-use

While our next version release will support embedded JavaScript (enabled via a configuration file change), there are many alternatives that fit into our 'best practice' guidelines. The most popular is to add a JavaScript metadata field to house your scripts. Another approach (if using PageBuilder) is to develop a widget that can house scripts and perform appropriate registrations. You can find working widget code here .