Reputation: 866
I'm sending an ajax request with relative url
$.post("wp-content/themes/site/function.php", {
}, function (data) {});
It's working fine if my url is http://yourdomain.com/page. But if the url is http://yourdomain.com/page/
then it's sending http://yourdomain.com/page/wp-content/themes/site/function.php. but I want http://yourdomain.com/site/wp-content/themes/function.php
Upvotes: 2
Views: 92
Reputation: 4883
try with a leading /
:
$.post("/wp-content/themes/site/function.php", {}, function (data) {});
Upvotes: 6