Title: Unable To Use Javascript with Theme Editor
Last modified: August 18, 2016

---

# Unable To Use Javascript with Theme Editor

 *  Resolved [fouriertransform](https://wordpress.org/support/users/fouriertransform/)
 * (@fouriertransform)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/unable-to-use-javascript-with-theme-editor/)
 * I’m completely unable to include any javascript in any of my templates via the
   Theme Editor, which is really frustrating. I paste in the code – between proper
   script tags, obviously:
 *     ```
       <script type="text/javascript">
       <!--
       my code goes here
       //-->
       </script>
       ```
   
 * – hit UPDATE FILE, and then I get the theme’s ERROR 404 page, although the URL
   is still /theme-editor.php.
 * I can include script via phpMyAdmin, and obviously via FTP if I update the page
   offline, but then any further edits to that page via the Theme Editor cause the
   Error 404, because the page contains javascript. I’ve tried CDATA tags, and that
   doesn’t work either.
 * This happened in 2.0.5, so I upgraded to 2.3.1 and it’s still happening. The 
   server I’m using has PHP v.5.2.4 and mySQL v.4.1.22
 * Any ideas?
 * UPDATE: It’s not necessarily the script itself, I’ve just discovered that it’s
   the `<script></script>` tags that are causing the problem. The following both
   produce a 404 error on trying to update the theme file:
 *     ```
       <script>
       </script>
       ```
   
 *     ```
       <script type="text/javascript">
       </script>
       ```
   
 * Why would script tags be messing things up? It doesn’t make any sense.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 6 months ago](https://wordpress.org/support/topic/unable-to-use-javascript-with-theme-editor/#post-645017)
 * I can do this with my copy of WordPress just fine, so I suspect that your site
   is running some kind of security thing, like mod_security or something else.
 *  [dprundle](https://wordpress.org/support/users/dprundle/)
 * (@dprundle)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/unable-to-use-javascript-with-theme-editor/#post-645136)
 * Did you ever find a solution to this?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Unable To Use Javascript with Theme Editor’ 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/)
 * 2 replies
 * 3 participants
 * Last reply from: [dprundle](https://wordpress.org/support/users/dprundle/)
 * Last activity: [18 years, 6 months ago](https://wordpress.org/support/topic/unable-to-use-javascript-with-theme-editor/#post-645136)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
