I am using this code in php or html file for redirect
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var country= geoip_country_code();
if(country == "US" )
{
<!--
window.location = "http://google.com"
//-->
}
</script>
but i want to use a js file which do the same function but its extension should be .js
as http://domain.com/redirect.js so what would be the code?