Tuesday, October 7, 2008

JavaScript get domain name


function baseDomainString(){
e = document.domain.split(/\./);
if(e.length > 1) {
return("domain=" + e[e.length-2] + "." + e[e.length-1]) + ";" ;
}else{
return("");
}
}

No comments: