Languages

Menu
Sites
Language
How the Internet Connection Status should display to user.

Hi,

I have develop Currency Converter application in which i retrrieve currency rate using online API.This application not work when there is no internet connection. How the Internet Connection Status should display to user.

 

 

thanks and regards

Mohit Kumar

View Selected Answer

Responses

3 Replies
Mark as answer
Marco Buettner

You can use 

var isOnline = navigator.onLine;

if(isOnline) {
    // DO YOU CODE FOR ONLINE STATE
} else {
    // DO YOU CODE FOR OFFLINE STATE
}

 

mohit kumar

Hi,

 

Thank You so much

 

Thanks and regards

Mohit Kumar

Vikram

Hi,

You can refer to the detail guide for check Internet Connection Status and sample code

https://developer.tizen.org/development/tutorials/web-application/w3chtml5supplementary-features/device/html5-browser-state-0