[code:1:53de74411e]location = {
host: “stackoverflow.com”,
hostname: “stackoverflow.com”,
href: “http://stackoverflow.com/questions/2300771/jquery-domain-get-url”,
pathname: “/questions/2300771/jquery-domain-get-url”,
port: “”,
protocol: “http:”
}[/code:1:53de74411e]
So .. use:
[code:1:53de74411e]location.protocol + “//” + location.host[/code:1:53de74411e]
Source: http://stackoverflow.com/questions/2300771/jquery-domain-get-url/13509716?stw=2#13509716
Leave a Reply