Hi, I have some code that if I'm at home; it will display at popup saying that if you are at home. If you are not at home it will display a popup saying you are not at home. As the script is located on a server to give an IP address, how can I get it to say if you are not connected to the internet, as it will fail to load so I would have though that ip!="" would work but doesn't what have I done wrong? Thanks
<script type="application/javascript">
function getip(json)
{
ip=json.ip
if(ip!="")
{
if(ip=="123.123.123.123")
{
alert("You are at home");
}
else
{
alert("you are not at home");
}
}
else
{
alert("You are not connected to the internet");
}
}
</script>
<script type="application/javascript" src="http://jsonip.appspot.com/?callback=getip">
</script>