If code is being stripped in Joomla 2.5 there are two places to check:
1. Global Configuration -> Text Filters
Set to "No Filtering" for Super Users (or whichever group you want to allow)
2. In the text editor plugin settings make sure code is not being cleaned.
For example the default TinyMCE plugin has a list of "Prohibited Elements" (script,applet).