Doc: Readme and util api

This commit is contained in:
surunzi
2017-12-18 14:24:24 +08:00
parent 8275b53a4c
commit 2f9b39769b
2 changed files with 20 additions and 17 deletions

View File

@@ -1009,6 +1009,24 @@ if (browser.name === 'ie' && browser.version < 9)
}
```
## detectOs
Detect operating system using ua.
|Name |Type |Desc |
|------------------------|------|---------------------|
|[ua=navigator.userAgent]|string|Browser userAgent |
|return |string|Operating system name|
Supported os: windows, os x, linux, ios, android, windows phone
```javascript
if (detectOs() === 'ios')
{
// Do something about ios...
}
```
## each
Iterate over elements of collection and invokes iteratee for each element.
@@ -1857,21 +1875,6 @@ query.stringify({foo: 'bar', eruda: 'true'}); // -> 'foo=bar&eruda=true'
query.parse('name=eruda&name=eustia'); // -> {name: ['eruda', 'eustia']}
```
## ready
Invoke callback when dom is ready, similar to jQuery ready.
|Name|Type |Desc |
|----|--------|-----------------|
|fn |function|Callback function|
```javascript
ready(function ()
{
// It's safe to manipulate dom here.
});
```
## repeat
Repeat string n-times.