I have several wordpress sites installed in subfolders under a top level domain:

  1. http://www.mydomain.com/site-a/
  2. http://www.mydomain.com/site-b/

I need to load an AJAX file in each of them, and I've used the following code:

// Initiate asynchronous load of xml data:
jQuery.ajax({
    type: "GET",
    url: "/wp-content/themes/mytheme/data.xml",
    dataType: "xml",
    success: parseDataXML
});

but that ends up searching for the file in the domain's root path:

http://www.mydomain.com/wp-content/themes/mytheme/data.xml

Instead of the site's root path:

http://www.mydomain.com/site-a/wp-content/themes/mytheme/data.xml
Edit
Report