callbackName

This commit is contained in:
Leo Horie 2016-05-26 11:19:39 -04:00
parent bdd65b3b86
commit 0ad6749f87
3 changed files with 23 additions and 1 deletions

View file

@ -1,5 +1,20 @@
## Change Log
[v0.2.5](http://mithril.js.org/archive/v0.2.5)
### News:
- performance improvements in IE (thanks to @gyandeeps)
- m.request now has a `callbackName` option to specify the name of the javascript function that gets called on JSONP response [#1072](https://github.com/lhorie/mithril.js/issues/1072)
### Bug Fixes:
- fix active form element syncing [#691](https://github.com/lhorie/mithril.js/issues/691)
- ignore url interpolations without value in m.request [#1039](https://github.com/lhorie/mithril.js/issues/1039)
- fixed native promise absorption in `m.prop` [#1076](https://github.com/lhorie/mithril.js/issues/1076)
---
[v0.2.4](http://mithril.js.org/archive/v0.2.4)
### Bug Fixes:

View file

@ -448,6 +448,7 @@ where:
String dataType,
String url,
String callbackKey,
String callbackName,
Object<any> data
}
```
@ -661,6 +662,12 @@ where:
This option is useful for web services that use uncommon conventions for defining jsonp callbacks (e.g. foo.com/?jsonpCallback=doSomething)
- **String callbackName**
The name of callback function to be called by the response. Defaults to a unique auto-generated name
This option is useful for web services serving static files and to prevent cache busting.
- **Object<any> data** (optional)
Data to be sent. It's automatically placed in the appropriate section of the request with the appropriate serialization based on `method`

View file

@ -2042,7 +2042,7 @@
function identity(value) { return value }
function handleJsonp(options) {
var callbackKey = "mithril_callback_" +
var callbackKey = options.callbackName || "mithril_callback_" +
new Date().getTime() + "_" +
(Math.round(Math.random() * 1e16)).toString(36)