Title: Customize javascript function
Last modified: September 1, 2016

---

# Customize javascript function

 *  Resolved [florent71](https://wordpress.org/support/users/florent71/)
 * (@florent71)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/customize-javascript-function/)
 * Hi Antoine,
    I want to customize the “do_countdown” javascript function. To do
   this, I use footballpool_post_init hook to add this line : `Football_Pool_Utils::
   include_js( "pool_child.js", 'js-pool', null, false, WP_PLUGIN_DIR . "/football-
   pool-child/assets/" );`
 * But it’s not working, my javascript function is not loaded 🙁
 * Any idea ?
 * Thanks in advance,
    -Florent
 * [https://wordpress.org/plugins/football-pool/](https://wordpress.org/plugins/football-pool/)

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

 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/customize-javascript-function/#post-7642480)
 * I’ll look into it next week. I’m on holiday at the moment and not able to check
   the code.
 *  Plugin Author [AntoineH](https://wordpress.org/support/users/antoineh/)
 * (@antoineh)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/customize-javascript-function/#post-7642566)
 * Seems like my function is only useable for scripts within the plugin root. Because
   your file is in its own directory, I recommend just using WP’s own functions 
   for registering the script, e.g.
 *     ```
       $handle = 'js-pool-child';
       wp_register_script( $handle, WP_PLUGIN_URL . '/football-pool-child/assets/pool_child.js', 'pool-js', FOOTBALLPOOL_DB_VERSION );
       wp_enqueue_script( $handle );
       ```
   
 * Also, make sure your script gets its own handle and – if needed – use the $deps
   parameter (as in my example) to make sure it loads after my script is loaded.

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

The topic ‘Customize javascript function’ is closed to new replies.

 * ![](https://ps.w.org/football-pool/assets/icon-256x256.png?rev=983880)
 * [Football Pool](https://wordpress.org/plugins/football-pool/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/football-pool/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/football-pool/)
 * [Active Topics](https://wordpress.org/support/plugin/football-pool/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/football-pool/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/football-pool/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [AntoineH](https://wordpress.org/support/users/antoineh/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/customize-javascript-function/#post-7642566)
 * Status: resolved