Get your own customer support community
 

How can I include JavaScript in a content area that doesn't overwrite itself?

Let's say I go into HTML view on a content area. It reads:


<div id="foo">Hello world</div>


Then I add:


<script type="text/javascript">
document.getElementById('foo').innerText = 'Goodbye world';
</script>


When I now return to editing the page, my JavaScript will actually overwrite the original 'Hello world' permanently, rather than dynamically on every page load. Obviously this extends to more complex scenarios, such as the embedding of Flash videos.

When dynamic JavaScript runs, its result gets burned into the Edicy content area, which then autosaves, making the change static!

This is as much a question as a problem report. Perhaps you could either not run any JavaScript entered into a content area's HTML when in edit mode, or filter a 'bogus' property, e.g.


<script type="text/javascript" unless="editmode">
 
sad I’m frustrated
Inappropriate?
1 person has this question

User_default_medium