We tried to check authentication.We have username and password.We need if net_Work is available in mobile.authentication check through online. internet is not in mobile We need show alert first connected internet Ajax call authentication check :-
function authentication()
{
username=$("#name").val();
password=$("#psw").val();
$('#empty').append("Authentication Will be Checking.......");
$.ajax({
url: 'http://183.82.0.221:1234/MyService.svc/GetAuthenticatedUserData/'+username+'/'+password+'',
dataType: 'jsonp',
type:'get',
cache:false,
success:function(data) {
if(data==1)
{
first();
}
else
{
alert("Authentication Failed");
}
}
});
}
Above code is only if internet have mobile.it's working fine. If mobile don't have internet it's not response any thing.
if mobile don't have internet, We need Show alert("this app need internet so Please connect first");