Wysiwyg / TinyMCE stripping Javascript code

6 posts by 3 authors in: Forums > CMS Builder
Last Post: January 15, 2010   (RSS)

By garyhoffmann - January 14, 2010

Hi,

I'm using the HTML button from within TinyMCE and trying to insert the following:

<SCRIPT LANGUAGE="JavaScript" src="http://code.javahd.com/js/topbiz.js" type="text/JavaScript"></SCRIPT>

It's stripping out the "src=..." parameter.

I also tried to insert this:

<script language="JavaScript" type="text/javascript">
v_theflv='topbiz.flv';
v_flvbase='hosted';
v_alignvideo='bottomleft';
</SCRIPT>

ended up getting this:

<script language="JavaScript" type="text/javascript">// <![CDATA[
v_theflv='topbiz.flv';
v_flvbase='hosted';
v_alignvideo='bottomleft';
// ]]></script>

Any ideas what I can do to insert javascript into a page's content section?

Thanks in advance,
Gary

Re: [garyhoffmann] Wysiwyg / TinyMCE stripping Javascript code

By Dave - January 15, 2010

Hi Gary,

It's better not to do it that way. What pages do you need it on? Is it possible to put it in the viewer file?

Or create a checkbox called show-topbiz and then have this in the viewer:

<?php if ($record['show-topbiz']): ?>
<SCRIPT LANGUAGE="JavaScript" src="http://code.javahd.com/js/topbiz.js" type="text/JavaScript"></SCRIPT>
<?php endif ?>

Would that work for you?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Wysiwyg / TinyMCE stripping Javascript code

By garyhoffmann - January 15, 2010

This is just one example - I may need to have embedded javascript on many pages, different on each page, so having it in the viewer would not work.

Do you know what's causing tinymce to change the javascript? There must be a setting somewhere within it causing it.

Otherwise I'll have to come up with some other "trick" to get around it. I would just rather not have to play all these coding tricks.

Re: [chris] Wysiwyg / TinyMCE stripping Javascript code

By garyhoffmann - January 15, 2010

Awesome - I will give that a shot and see what happens - THANK YOU.

Gary.

Re: [garyhoffmann] Wysiwyg / TinyMCE stripping Javascript code

By garyhoffmann - January 15, 2010

That did the trick! Thanks tons.
Gary.