# Javascript url for my module

**URL:** <https://www.dolibarr.org/forum/t/javascript-url-for-my-module/12512>\
**Category:** Developing for Dolibarr\
**Created:** [September 7, 2015, 1:22pm UTC](https://www.dolibarr.org/forum/t/javascript-url-for-my-module/12512 "2015-09-07T13:22:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgribaudo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/mgribaudo/32/3096_2.png) [@mgribaudo](https://www.dolibarr.org/forum/u/mgribaudo)\
**Post date:** [September 7, 2015, 1:22pm UTC](https://www.dolibarr.org/forum/t/javascript-url-for-my-module/12512/1 "2015-09-07T13:22:24Z")

</div>

Hi all,

I’m testing my new module to work in both directory:

- htdocs/custom/mymodule  
- htdocs/mymodule

No problem with php code, as described in the [Validation Rules Page](http://wiki.dolibarr.org/index.php/Module_Dolistore_Validation_Rules).  
But I don’t know how to do it in the javascript part of my page.  
Practically in the following part of the script:

$(location).attr(‘href’,’".DOL\_URL\_ROOT."/\<mymodule\>/\<myphppage\>’+parameters);

the \<mymodule\> should be able to have two values depending on the directory  
Not in all cases , in my module, is possible to use the relative path.  
.  
How can I do?

Thanks  
Marcello

---

<div class="post-metadata">

**Author:** ![Janhavi](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/f19dbf/32.png) [@Janhavi](https://www.dolibarr.org/forum/u/Janhavi)\
**Post date:** [December 3, 2019, 4:30am UTC](https://www.dolibarr.org/forum/t/javascript-url-for-my-module/12512/2 "2019-12-03T04:30:09Z")

</div>

I don’t know much about this. You may refer any java/php guide. Thanks for sharing!
