Check For Network Access

From NimbleKit

Jump to: navigation, search

[edit] To check for any network access

Place the following script in the <head> section of any page in your app that requires an internet connection (e.g., contains links to external websites):

<script type="text/javascript"> if ((NKIsInternetAvailableViaWifi() == 0) && (NKIsInternetAvailableViaCellularNetwork() == 0)) { NKAlert("Note:", "No internet connection is currently available.") } </script>

[edit] Check for wi-fi access

Place the following script in the <head> section of your page:

<script type="text/javascript"> if (NKIsInternetAvailableViaWifi() == 1) { NKAlert("Note:", "A Wi-Fi internet connection is available.") } </script>

[edit] Check for 3G access

Place the following script in the <head> section of your page:

<script type="text/javascript"> if (NKIsInternetAvailableViaCellularNetwork() == 1) { NKAlert("Note:", "A cellular internet connection is available.") } </script>

Personal tools