Title: Adding Javascript to a single page
Last modified: August 22, 2016

---

# Adding Javascript to a single page

 *  [aiofe](https://wordpress.org/support/users/aiofe/)
 * (@aiofe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-to-a-single-page-1/)
 * I have looked at the related questions and have tried a lot of the solutions 
   but can’t seem to get this to work.
 * Basically I have a script that a user can input a selection from 1 to 10 and 
   the result is displayed in a radar graph.
 * I need this to work on a single page but can’t figure it out. I have tried the
   Javascript Codex but am not getting anywhere. I am likely adding the wrong code
   to the wrong places / wrong files.
 * An example of the code working as a standalone is at codepen here:
    [http://codepen.io/anon/pen/KpAGu](http://codepen.io/anon/pen/KpAGu)
 * Any help is greatly appreciated on what to add to where and into which file.
 * Thanks!

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

 *  anonymized-13749270
 * (@anonymized-13749270)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-to-a-single-page-1/#post-5433560)
 * hello,
    i don’t think pasting the entire JS code into a page or a post HTML is
   a good idea. log in to your server, create an html file there and then use iframe,
   or, create a js file and instead of pasting the entire js code, do this : ( for
   example )
 *     ```
       <script src="/js/name.js">
       HTML goes here
       ```
   
 * have you tried that ?
 *  Thread Starter [aiofe](https://wordpress.org/support/users/aiofe/)
 * (@aiofe)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-to-a-single-page-1/#post-5433575)
 * I’ve tried referencing the .js file in the post and putting the HTML beneath 
   it but it doesn’t work…
 *  anonymized-13749270
 * (@anonymized-13749270)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-to-a-single-page-1/#post-5433584)
 * > I’ve tried referencing the .js file in the post and putting the HTML beneath
   > it but it doesn’t work…
 * ok then, use a frame !
    in your server somewhere create an HTML or PHP file, 
   put the entire js and html/css , then in your page call the frame `<iframe src
   ="_" height="_" width="_"></iframe>`

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

The topic ‘Adding Javascript to a single 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: anonymized-13749270
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/adding-javascript-to-a-single-page-1/#post-5433584)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
