Title: Plugin calling js file with wrong path
Last modified: August 19, 2016

---

# Plugin calling js file with wrong path

 *  Resolved [Jeremy Herve](https://wordpress.org/support/users/hd-j/)
 * (@hd-j)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-calling-js-file-with-wrong-path/)
 * I have a problem with one of my plugins, and I would need your help:
 * In the plugin, I call the files in wp_head this way:
 *     ```
       wp_enqueue_script('jquery');
       		wp_enqueue_script(
       			'jqueryui',
       			$this->dir.'/js/jquery-ui.js',
       			array('jquery')
       		);
       		wp_enqueue_script(
       			'categoryAccordion.ready',
       			$this->dir.'/js/ready.js',
       			array('jqueryui')
       		);
       ```
   
 * However, When loading up blog, the source code shows me that these dir. variable
   does not work as I would like:
 *     ```
       <script type='text/javascript' src='http://testsite.dev/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>
       <script type='text/javascript' src='http://testsite.dev/C:AppServwwwblogwp-contentpluginscategory-accordion/js/jquery-ui.js?ver=2.9.1'></script>
       <script type='text/javascript' src='http://testsite.dev/C:AppServwwwblogwp-contentpluginscategory-accordion/js/ready.js?ver=2.9.1'></script>
       ```
   
 * Any idea about what’s happening to me?
 * Thanks for your help!

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

 *  Thread Starter [Jeremy Herve](https://wordpress.org/support/users/hd-j/)
 * (@hd-j)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-calling-js-file-with-wrong-path/#post-1370928)
 * Hi again!
 * Any chance that somebody got the same problem than me once, and could help?
 * Thanks!
 *  Thread Starter [Jeremy Herve](https://wordpress.org/support/users/hd-j/)
 * (@hd-j)
 * [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-calling-js-file-with-wrong-path/#post-1370931)
 * Alright, I changed the way I was calling the files, it solved the issue:
 *     ```
       wp_enqueue_script('jquery');
       		wp_enqueue_script(
       			'jqueryui',
       			plugins_url($path = 'category-accordion/js/jquery-ui.js'),
       			array('jquery')
       		);
       		wp_enqueue_script(
       			'categoryAccordion.ready',
       			plugins_url($path = 'category-accordion/js/ready.js'),
       			array('jqueryui')
       		);
       ```
   

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

The topic ‘Plugin calling js file with wrong path’ is closed to new replies.

## Tags

 * [local](https://wordpress.org/support/topic-tag/local/)

 * 2 replies
 * 1 participant
 * Last reply from: [Jeremy Herve](https://wordpress.org/support/users/hd-j/)
 * Last activity: [16 years, 4 months ago](https://wordpress.org/support/topic/plugin-calling-js-file-with-wrong-path/#post-1370931)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
