Determining relative path with jQuery Determining relative path with jQuery jquery jquery

Determining relative path with jQuery


Get rid of the leading "/" in the url path. The leading slash means "from the root of the site", not "from my current folder".

Edit: Ok, then in the root index of each "site", you need to define BASE HREF to include that folder name. Then the leading slash should take into account that value instead of the site root.


My best bet would be check location, like:

var pathname = window.location.pathname;

And then do some indexOf() to specify which WP installation to point to.


It's because you started your url with / that makes it an absolute url. To make it a relative url change it to url: "wp-content/themes/mytheme/data.xml",.