Below is the code i have developed till now:
$extension = pathinfo($_SERVER['SERVER_NAME'], PATHINFO_EXTENSION);
if($extension == "de")
{
echo "this is a german site";
}
The above function is simple and works well in php, though i need it in javascript, how should i rewrite it?