I’m trying to add some JavaScript into one of my WordPress pages. When I change the text area to HTML mode and paste in the JavaScript then save my changes. It does not appear on the page itself. Can someone please help me allow JavaScript in the default WordPress page text editor?
The JavaScript that I am trying to input is:
<script type="text/javascript">
jQuery(function($){
$.supersized({
random : 1,
slide_interval : 3000,
transition : 3,
transition_speed : 900,
slide_links : 'blank',
});
});
</script>
WordPress is really picky about how you do the newlines and it will sometimes place
<p>tags in there which will mess up JavaScript code. I would recommend looking at the source after you make the post and see if any of the<p>tags got incorporated. If so, go back and delete the white-spacing in that area and try again.In the worst case, you can always use the Raw HTML plugin which will render the raw code for you:
http://wordpress.org/extend/plugins/raw-html/