Skip to content

Commit cd5eaf7

Browse files
author
a-jie
committed
update readme
update readme
1 parent ce046ea commit cd5eaf7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ npm install fetch-jsonp-polyfill --save-dev
99
```
1010

1111
## Notice
12-
It is compatible with almost all mainstream jsonp polyfills libraries. E.g[https://github.com/github/fetch](https://github.com/github/fetch) [https://github.com/matthew-andrews/isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) [https://github.com/bitinn/node-fetch](https://github.com/bitinn/node-fetch)
12+
It is compatible with almost all mainstream jsonp polyfills libraries. E.g [https://github.com/github/fetch](https://github.com/github/fetch) [https://github.com/matthew-andrews/isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) [https://github.com/bitinn/node-fetch](https://github.com/bitinn/node-fetch)
1313

1414
##### But it is important to note that you must import 'fetch-jsonp-polyfill' after them.
1515

@@ -25,11 +25,10 @@ import 'fetch-jsonp-polyfill'
2525

2626
## Usage
2727
You don't need to make any changes, just modify the `method:'GET'` to `method:'JSONP'`.
28-
In this way, I didn't modify any native code.
29-
```
30-
var URL = 'http://jsfiddle.net/echo/jsonp/';
28+
So simple, in fact I have almost no modifications.
3129

32-
fetch(URL, {
30+
```
31+
fetch('http://jsfiddle.net/echo/jsonp/?hello=world', {
3332
method: "JSONP"
3433
})
3534
.then(res => res.json())
@@ -38,7 +37,7 @@ fetch(URL, {
3837
})
3938
.catch(err => {
4039
console.log(err);
41-
});
40+
})
4241
```
4342

4443
## Other Options

0 commit comments

Comments
 (0)