If you want to insert any Javascript into a Joomla article using JCE Editor Pro (my preferred editor in Joomla) you may need to enable this in the Editor Profiles for the profile you are using to prevent the code from being stripped.
Go to Components -> JCE Editor Pro -> Profiles and select the appropriate profile.
Select the tab Editor Parameters and scroll down the left hand column to find the Advanced option. Then scroll down this section to find the Code Blocks section. Change the setting to Yes for Allow Javascript.



