How to not write the full url in javascript ?
- by Axel
Hi,
I did a Mod rewrite for my website so the URLs looks like this :
http://www.mydomain.com/health/54856
http://www.mydomain.com/economy/strategy/911025/
http://www.mydomain.com/tags/obama/new
So, the problem is that i make AJAX calls to a file here : http://www.mydomain.com/login.php
And i don't want to write the FULL url or even use ../ trick because there isn't a fixed number of folders.
So, what i want now, is something worked for my code to access the login.php from the root whatever the domain name is :
$.ajax({
type: "POST",
url: "http://www.mydomain.com/login.php"
});