Javascript in Wordpress &quot;Pages&quot;

Ok i have a specific javascript code which when placed on a certain spot on a page, will fetch data from a server and display information right there in on that exact spot. I know how to get this done in &quot;Posts&quot; by adding the following in the editor

This will display the information perfectly right where i want it in a Post.

How do i do this for a &quot;Page&quot;? It seems Wordpress is stripping the Javascript when the page is called for viewing. It however remains in the editor view at all times. For &quot;Post&quot; pages it does not strip the javascript if i use the above code, but using the above code for &quot;Pages&quot;, it gets stripped out.