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

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -