Insert Javascript in the WYSIWIG HTML?

mwinning's Avatar

mwinning

05 Oct, 2010 06:40 PM

Whenever I try to embed javascript in the HTML via the WYSIWIG, some of the tags get stripped out when I make a change to another area of the page. Is there a setting to allow scripts to stay intact?

Thanks!

  1. 1 Posted by Penny on 07 Oct, 2010 07:05 PM

    Penny's Avatar

    Can you attach the code that is being altered?

    I generally stay away from putting javascript in the WYSIWYG b/c of this reason and that some users going to the page to edit may not know that it is in there and then blow it away when they replace the WYSIWYG content. I usually add an additional region to my template and then fill in the javascript using an xml block or text field.

    I would try to disable tidy for those pages if you are going to put the javascript in the WYSIWYG and see if that helps.

    I hope this helps.

  2. 2 Posted by kenton.hankins on 27 Oct, 2010 09:11 PM

    kenton.hankins's Avatar

    I usually just inlcude a php file. Then inside the php file I include the javascript (so the php file contains no actual php code only js). This way you can update your js without having to edit the block then republish your page.

  3. mwinning closed this discussion on 08 Nov, 2010 06:35 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac