Javascript url for my module

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.
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

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