Title: Installing a basic JavaScript. Am I doing it right?
Last modified: August 20, 2016

---

# Installing a basic JavaScript. Am I doing it right?

 *  [Ryder911](https://wordpress.org/support/users/ryder911/)
 * (@ryder911)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/installing-a-basic-javascript-am-i-doing-it-right/)
 * I have relatively simple JavaScript I’d like to install on a single page of my
   blog. I’ve been reading various tutorials here and elsewhere and, unfortunately,
   all of them assume that I already have a basic understanding of how JavaScripts
   work within WP as well as the commands, which I do not.
 * Assuming I want to install a script called “test.js”, please let me know if the
   following steps are correct?:
 * **STEP 1.** Open my theme header.php and add this line of code:
    <script type
   =”text/javascript” src=”/scripts/test.js”></script>
 * **STEP 2.** Create a new folder on my host called “scripts”. However, I’m unsure
   of the path? Should this new folder go into the general site folder or the sub
   admin folder containing all of the WP files?
    I also noticed that there is an
   existing JavaScript folder called “js”. Alternatively, should I just install 
   the script here and set the source to: src=”/js/test.js” in **Step 1** instead?
 * **STEP 3.** Lastly, to call the script up, I assume I need to open the editor
   of the page where I want to have it installed and add the source code. Correct?
   If so (and this is where I’m having problems with the tutorials not being basic
   enough), would the following code be correct:?
 * <div class=”test”>
    <script type=”text/javascript”><!–//–><![CDATA[//><!– test();//–
   ><!]]></script> </div>
 * Thanks for any and all advice.

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

 *  [Josh](https://wordpress.org/support/users/josh401/)
 * (@josh401)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/installing-a-basic-javascript-am-i-doing-it-right/#post-2869965)
 * This plugin will help you tremendously:
 * [http://wordpress.org/extend/plugins/scripts-n-styles/](http://wordpress.org/extend/plugins/scripts-n-styles/)
 *  Thread Starter [Ryder911](https://wordpress.org/support/users/ryder911/)
 * (@ryder911)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/installing-a-basic-javascript-am-i-doing-it-right/#post-2870014)
 * Thanks Josh, but I still couldn’t get it to work properly. The script ran but
   would only install either above the page header or below the page footer.
 * I modified my header.php and tried running a simple script from my host, and 
   that didn’t work either. 🙁

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

The topic ‘Installing a basic JavaScript. Am I doing it right?’ 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
 * 2 participants
 * Last reply from: [Ryder911](https://wordpress.org/support/users/ryder911/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/installing-a-basic-javascript-am-i-doing-it-right/#post-2870014)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
