jquery - Javascript Geo Redirection not working -


my code gives blank page. no redirection occurs

<script src="http://code.jquery.com/jquery-latest.js"></script>  <script language='javascript'>    $.getjson( "http://smart-ip.net/geoip-json?callback=?", function(data){     if (data.countrycode == "ca") {       window.location = 'canada.php';    } else {      window.location = 'usa.php';    }     </script> 

you script missing termination code.

place }); right before </script>.

so code should this...

<script src="http://code.jquery.com/jquery-latest.js"></script>  <script language='javascript'>    $.getjson( "http://smart-ip.net/geoip-json?callback=?", function(data){     if (data.countrycode == "ca") {       window.location = 'canada.php';    } else {      window.location = 'usa.php';    }    }); </script> 

Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -