Title: Recommended way to include a JavaScript file
Last modified: August 20, 2016

---

# Recommended way to include a JavaScript file

 *  Resolved [MineForeman.com](https://wordpress.org/support/users/mineforemancom/)
 * (@mineforemancom)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/recommended-way-to-include-a-javascript-file/)
 * Hi All,
 * Can anyone tell me the recommended method to include a new JavaScript file with
   the Responsive Child Theme?
 * I have done a Google and found about 9 different ways so I thought I would come
   straight to the horses mount and ask here.
 * The method I like the most is to add a functions.php to the child theme and put;-
 * <?php
 * function myJS_link() {
    echo ‘<script language=”javascript” src=”JavaScriptFileName.
   js”> </script>’ . “\n”; } add_action( ‘wp_head’, ‘myJS_link’ );
 * Is that a good way of doing it?
 * Thanks heaps
 * Neil

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

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/recommended-way-to-include-a-javascript-file/#post-3303116)
 * Here’s the WP word on it
 * [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)
 * But you may also want to look at Responsive’s dedicated forums as Emil always
   has really great help for his themes:
 * [http://themeid.com/forum/](http://themeid.com/forum/)
 *  [Emil Uzelac](https://wordpress.org/support/users/emiluzelac/)
 * (@emiluzelac)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/recommended-way-to-include-a-javascript-file/#post-3303174)
 * Create a functions.php in your Child Theme and see this paste please [http://pastebin.com/iUynbySg](http://pastebin.com/iUynbySg)
 * Emil

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

The topic ‘Recommended way to include a JavaScript file’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/responsive/6.3.5/screenshot.png)
 * Responsive
 * [Support Threads](https://wordpress.org/support/theme/responsive/)
 * [Active Topics](https://wordpress.org/support/theme/responsive/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/responsive/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/responsive/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Emil Uzelac](https://wordpress.org/support/users/emiluzelac/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/recommended-way-to-include-a-javascript-file/#post-3303174)
 * Status: resolved