Well i'm currently have some issue about manipulating an URL.
Technically what i want is to get the domain name and the page name from a page.
For example :
www.myWebSite.com => domain : myWebSite
http://myWebSite.com => domain : myWebSite
myWebSite.com/xxx.hmtl => domain : myWebSite page : xxx
window.location.hostname; //Domain name
$("title").text(); //Page name
EDIT:
var loc = window.location;
var filename = loc.pathname.split("/");
filename = filename[pathname.length-1];
alert("Domain: "+loc.hostname);
alert("Filename: "+filename);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With