Update README.md

pull/3/head
呓喵酱 5 years ago committed by GitHub
parent 657093fcf1
commit 9c9bc8a445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      README.md

@ -73,6 +73,26 @@ A simple example:
</script>
```
### Cookie
fp preloads [iotcat/cookie-js](https://github.com/iotcat/cookie-js), support all of its functions.
**usage**
`cookie.set(key, val, days)`: set a cookie, with key name, value, days to live(defaule: 10 years)
`cookie.get(key)`: get cookie with key
`cookie.del(key)`: delete cookie with key
**example**
```js
//set a cookie named iotcat,its value is hero,live for 30 days
cookie.set("iotcat", "hero", 30);
//get the value of the cookie iotcat
alert(cookie.get("iotcat"));
//delete the cookie of iotcat
cookie.del("iotcat");
```
## CDN
- China: `https://cdn.yimian.xyz/fp/fp.min.js`

Loading…
Cancel
Save