small tweaks to docs
This commit is contained in:
parent
c5c18f9231
commit
87dcbbf5c7
19 changed files with 308 additions and 75 deletions
|
|
@ -1,19 +1,19 @@
|
|||
# jsonp(options)
|
||||
|
||||
- [API](#api)
|
||||
- [Signature](#signature)
|
||||
- [How it works](#how-it-works)
|
||||
- [Typical usage](#typical-usage)
|
||||
|
||||
---
|
||||
|
||||
### API
|
||||
### Signature
|
||||
|
||||
`promise = m.jsonp(options)`
|
||||
|
||||
Argument | Type | Required | Description
|
||||
---------------------- | --------------------------------- | -------- | ---
|
||||
`options.url` | `String` | Yes | The URL to send the request to. The URL may be either absolute or relative, and it may contain [interpolations](#dynamic-urls).
|
||||
`options.data` | `any` | No | The data to be interpolated into the URL and serialized into the querystring (for GET requests) or body (for other types of requests).
|
||||
`options.data` | `any` | No | The data to be interpolated into the URL and serialized into the querystring.
|
||||
`options.type` | `any = Function(any)` | No | A constructor to be applied to each object in the response. Defaults to the [identity function](https://en.wikipedia.org/wiki/Identity_function).
|
||||
`options.callbackName` | `String` | No | The name of the function that will be called as the callback. Defaults to a randomized string (e.g. `_mithril_6888197422121285_0({a: 1})`
|
||||
`options.callbackKey` | `String` | No | The name of the querystring parameter name that specifies the callback name. Defaults to `callback` (e.g. `/someapi?callback=_mithril_6888197422121285_0`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue