I am using an iframe to embed a Google map in my page (intranet). If for whatever reason the user is not connected to the internet though the page should still load, just without the map.
I was thinking of using this:
$.ajax({
type: "GET",
url: "http://www.google.com",
timeout: "5000",
error: function(msg) {
$("#map").hide();
}
});
Two questions:
1) Currently it always fails even when I am online.
2) Is there a better page to ping instead of google.com? Maybe there is a lightweight Google API that would be better?
What am I doing wrong?
Thanks