Revision Update: Tested with the latest WordPress Beta 3 version and TinyMCE Advanced.
Revised on WordPress 3.5.1 and latest TinyMce Advance Plugin version 3.5.8
If you have updated the plugin to the latest version and you are running the latest WordPress version then your problem should be resolved.
I have tested the latest version of WordPress and TinyMce Advance Plugin on the following browsers running Windows 7.
The browsers tested:
- IE 9
- FireFox 18.0.2
- Chrome 25.0.1364.84
- Seamonkey 2.15.2
Remember: Always have the latest version of the browser installed. Make sure you clear your cache regularly. Make sure Java is updated.
I have set the Advanced options settings under TinyMCE Advanced settings to: Stop removing…… and now what you see when entering or copying the script code under HTML editor and saving it.
Your script is now enclosed between <p>code<p> html tags. See image below:

The following instructions are for those who are still using the old version of WordPress and an earlier version of TinyMCE Advanced plugin and are still having problems inserting JavaScript to pages or post.
To add a JavaScript file i.e from youtube to your page or post click on HTML on the top editors bar on your WordPress editor and paste your code into the page. See image below.

Once you are in the HTML editor paste or type your code. See image below.

The image above should work but what happens when you click on Visual tab and then click on HTML tab again the code disappears. This is very strange and I have tested the above on FireFox, IE, Chrome and Seamonkey browsers and get the same result. So in order to eliminate this issue after extensive research on the internet I came up with the conclusion of adding some code in between script tag and paragraph tag. By adding some html tag code it stops WordPress wysiwyg editor from striping the code. I added a line space html code see image below.

When you click on the Visual tab and then click on HTML tab, WordPress wysiwyg editor creates a space and 3 lines. See image below.
While you are in HTML editor click on update then click on Visual tab and again HTML tab and it adds a break html tag or in some case it might add 2 break html tags and also a space in between the break tag and the closing paragraph tag. See image below.

Now you can just leave the page and navigate else where in WordPress. This can become very messy and sometimes it does not work well depending on the browser you use. If you deactivate the plugin TinyMce Advance you will not experience the same issue above.
Alternative you can use one of these two plugins Pure Html and RawHtml, which works very well.
I have tested PureHTML in WordPress 3.5.1 and it works. Raw HTML recently was updated up to version 1.4.10 compatible with WordPress 3.6 Beta 2. I prefer Raw Html because it is kept up to date and more users have downloaded this plugin more than Pure Html. I have tested this version with the latest WordPress beta version 3 and it works well. Remember if it does not work for you, always report it to the developers. The culprit will always be another plugin or sometimes it is the theme. If you try this plugin make sure you create a backup just in case it causes other issues as previously mentioned.
I hope this helps you and puts you on the right track. If you need any help just leave a comment.
Come back for more information as I keep updating this post.
Good luck


