Title: JavaScript into single post
Last modified: August 21, 2016

---

# JavaScript into single post

 *  [cparente](https://wordpress.org/support/users/cparente/)
 * (@cparente)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-into-single-post/)
 * Hello, newbie question here. I need to add a form that requires Javascript to
   a single post on [http://www.chrisparente.com](http://www.chrisparente.com). 
   I’m trying to understand this section about adding JS:
 *  JavaScript in Posts
 * For the occasional or one time use of JavaScript, you **need to put the script
   into a JavaScript file** and then call it out from within the post. Make sure
   that each script is defined by its function name such as:
 * Where does this JS file go, once it’s created?
 * Thanks in advance.

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

 *  [Pioneer Web Design](https://wordpress.org/support/users/swansonphotos/)
 * (@swansonphotos)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-into-single-post/#post-4010844)
 * If after spending the time to review the Codex on such issues and you have not
   been able to proceed well, our continued advice is to either continue to study
   and apply at a not live site or dev site _and not your main site_, and if unable
   to do so please _consider hiring an expert_. We cannot rewrite the Codex today.
   Tomorrow maybe 🙂
 * That said, the code to your .js file goes in header.php or footer.php (theme 
   requirements ensue) and requires knowledge of at least HTML and likely PHP.
 *  Thread Starter [cparente](https://wordpress.org/support/users/cparente/)
 * (@cparente)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-into-single-post/#post-4010990)
 * Where do you read a request to rewrite anything? I’m asking for the procedure
   to be explained in a more granular manner. And I would have preferred to ask 
   the question in a thread already going on re the same topic, but was told by 
   a mod to start a new question.
 *  [CrouchingBruin](https://wordpress.org/support/users/crouchingbruin/)
 * (@crouchingbruin)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-into-single-post/#post-4010991)
 * If you want to add JavaScript to a post, you can just add it to the post itself
   by enclosing it in **<script> … </script>** tags. I do it all the time usually
   right at the beginning of the post. Just make sure you’re editing the post using
   the Text editor and not the Visual editor.
 *  Thread Starter [cparente](https://wordpress.org/support/users/cparente/)
 * (@cparente)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/javascript-into-single-post/#post-4011000)
 * Thanks CB. Wasn’t that easy for me. But I figured it out. Now visitors can use
   a price comparison to value tool on my site: [http://chrisparente.com/2013/08/07/can-an-equation-measure-wine-value/](http://chrisparente.com/2013/08/07/can-an-equation-measure-wine-value/)
 * Here’s some advice that hopefully will prove useful to the next person who searches
   on this issue:
 * 1. Always use Text Editor. This means using the Text editor the last time you
   edited anything – otherwise the post automatically opens in Visual.
 * 2. Get a plugin that ensures that WP doesn’t edit your pasted code in any way.
   I used Raw HTML.
 * That SHOULD work, without getting into any header or footer file issues, no saving
   a js file and calling to it, etc.
 *  [qsfrl](https://wordpress.org/support/users/qsfrl/)
 * (@qsfrl)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/javascript-into-single-post/#post-4011077)
 * THANK YOU cparente! I was looking at all the other javascript info pages and 
   it was way too complicated for what I wanted to do (embed a form on a page). 
   Using raw HTML worked perfectly.

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

The topic ‘JavaScript into single post’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 4 participants
 * Last reply from: [qsfrl](https://wordpress.org/support/users/qsfrl/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/javascript-into-single-post/#post-4011077)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
