mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-03-15 12:51:00 +08:00
Readme: Add fenced code blocks with langauage hints
This commit is contained in:
parent
bc8923ffe1
commit
808a2a71d9
10
README.md
10
README.md
@ -79,6 +79,7 @@ connection state, and type of connection.
|
|||||||
|
|
||||||
### Quick Example
|
### Quick Example
|
||||||
|
|
||||||
|
```js
|
||||||
function checkConnection() {
|
function checkConnection() {
|
||||||
var networkState = navigator.connection.type;
|
var networkState = navigator.connection.type;
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ connection state, and type of connection.
|
|||||||
}
|
}
|
||||||
|
|
||||||
checkConnection();
|
checkConnection();
|
||||||
|
```
|
||||||
|
|
||||||
### API Change
|
### API Change
|
||||||
|
|
||||||
@ -158,12 +159,13 @@ attach an event listener once the `deviceready` event fires.
|
|||||||
|
|
||||||
### Quick Example
|
### Quick Example
|
||||||
|
|
||||||
|
```js
|
||||||
document.addEventListener("offline", onOffline, false);
|
document.addEventListener("offline", onOffline, false);
|
||||||
|
|
||||||
function onOffline() {
|
function onOffline() {
|
||||||
// Handle the offline event
|
// Handle the offline event
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### iOS Quirks
|
### iOS Quirks
|
||||||
|
|
||||||
@ -197,12 +199,13 @@ attach an event listener once the `deviceready` event fires.
|
|||||||
|
|
||||||
### Quick Example
|
### Quick Example
|
||||||
|
|
||||||
|
```js
|
||||||
document.addEventListener("online", onOnline, false);
|
document.addEventListener("online", onOnline, false);
|
||||||
|
|
||||||
function onOnline() {
|
function onOnline() {
|
||||||
// Handle the online event
|
// Handle the online event
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### iOS Quirks
|
### iOS Quirks
|
||||||
|
|
||||||
@ -227,7 +230,6 @@ To start with, create a new FileEntry object (data.txt) to use for sample data.
|
|||||||
>*Note* This code example requires the File plugin.
|
>*Note* This code example requires the File plugin.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
||||||
var dataFileEntry;
|
var dataFileEntry;
|
||||||
|
|
||||||
function createSomeData() {
|
function createSomeData() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user