Missing javascript Options
Dobly
Posted: Tuesday, April 01, 2008 2:30:30 PM
Rank: Newbie

Joined: 3/15/2008
Posts: 15
So much for Umbraco leaving your content just as you enter it.

I have a simple html page that has a bit of javascript in it.

The problem is that when I paste the page content into a page that accepts what I call bodyText, it strips out the javascript. Note that when I paste in my HTML and javascript, I hit the HTML button. I don't paste into the 'richtext' window.

So, if I go to paste in my page content and it looks like this (truncated to keep the example small)

Code:

<td colspan="2">Read this message: >
<script language="JavaScript"><!-
document.write('Here is my message');
// -->
</script>
</a></td>


When I run the page what I get in the source code is this..

Code:

<td colspan="2">Read this message: >
</a></td>


Futhermore, if I return to the content for that page, and view the HTML, the javascript is gone.

What am I missing here? Why can't Umbraco just accept my markup as I enter it (something it claims to do but clearly doesn't).
dawoe
Posted: Tuesday, April 01, 2008 2:39:59 PM

Rank: Aficionado

Joined: 1/19/2008
Posts: 170
Location: Belgium
I think your script tags get stripped out by default.

Maybe you can change it in the file /config/tinyMceConfig.config in the section validElements.

But why would you allow editors to insert javascript in to a page ?

Converting a DotNetNuke site to Umbraco : Follow it here
Petr Snobelt
Posted: Tuesday, April 01, 2008 3:37:06 PM
Rank: Aficionado

Joined: 10/2/2007
Posts: 165
Location: Czech Republic
If you want to allow editors to insert javascript, create special macro for it or another property (not richtext)

Inserting into Richtext editor is generally bad idea.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.