Title: Javascript in a page
Last modified: August 19, 2016

---

# Javascript in a page

 *  [wrgood](https://wordpress.org/support/users/wrgood/)
 * (@wrgood)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/javascript-in-a-page/)
 * 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)

 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/javascript-in-a-page/#post-870589)
 * 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](https://wordpress.org/support/users/wrgood/)
 * (@wrgood)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/javascript-in-a-page/#post-870597)
 * makes the code look really messy to have it all on one line, but it works great,
   thanks for the help doodlebee
 *  [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * (@doodlebee)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/javascript-in-a-page/#post-870601)
 * 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.

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Doodlebee](https://wordpress.org/support/users/doodlebee/)
 * Last activity: [17 years, 8 months ago](https://wordpress.org/support/topic/javascript-in-a-page/#post-870601)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
