Hi all,
I need to detect whether Internet connection is there when my script loads, i used navigator.online it says" connection is there " if the PC in LAN and able to connect to internet, and also the path to my Gmap js files should load according the connection settings online and offline settings intially i tried
$(document).ready(function () {
$.ajax({
url: 'http://in.yahoo.com/',
success: function (data) {
alert('Connection.');
},
error: function (data) {
alert('No Connection.');
}
});
});
but this is also not working.
For which i added
protected void Application_BeginRequest(object sender, EventArgs e)
{
HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*");
}
in my Global.asax file
PLs suggest me i nearly spend a Day in searching,pls help me out