• I am trying to put javascript code into my wordpress page. i have googled this subject and dont seem to find the same problem.

    i have turned off the visual editor.

    i put this code into the post (this is not the actual code i want to use, but just want to start simple).

    <script type="text/javascript">
    <!--
    theInterval();
    //--></script>

    it then seems to format the code to look like this:

    <script type="text/javascript">
    <!--
    theInterval();
    //--></script>

    im guessing the reason it is not working is because of the p / br tags that are getting thrown in there. if anyone has any experience with this help would be much apreciated

    edit: i realized i didn’t mention, i include the js file in my header.php using this line of code

    <script src="slider/js/main.js" type="text/javascript"></script>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Don’t put in the line breaks. i.e. put all the code on one line, and the tags won’t break it:

    <script type="text/javascript">theInterval();</script>

    Thread Starter wrgood

    (@wrgood)

    makes the code look really messy to have it all on one line, but it works great, thanks for the help doodlebee

    yeah – but you’re the only one who’s gonna see it ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Javascript in a page’ is closed to new replies.