diff --git a/docs/mithril.route.md b/docs/mithril.route.md index d7b6a794..c91e30d3 100644 --- a/docs/mithril.route.md +++ b/docs/mithril.route.md @@ -167,7 +167,7 @@ m.route(document.body, "/", { m.route("/dashboard"); // logs "unloading home" ``` -This mechanism is useful to clear timers and unsubscribe event handlers. If you have a hierarchy of components, you can recursively call `unload` on all the components in the tree or use a [pubsub](http://microjs.com/#pubsub) library to unload specific components on demand. +This mechanism is useful to clear timers and unsubscribe event handlers. If you have a hierarchy of components, you can recursively call `onunload` on all the components in the tree or use a [pubsub](http://microjs.com/#pubsub) library to unload specific components on demand. --- diff --git a/mithril.js b/mithril.js index 81ff3f7f..91a0f5c1 100644 --- a/mithril.js +++ b/mithril.js @@ -1104,6 +1104,7 @@ var m = (function app(window, undefined) { var extract = xhrOptions.extract || function(xhr) { return xhr.responseText.length === 0 && deserialize === JSON.parse ? null : xhr.responseText }; + xhrOptions.method = (xhrOptions.method || 'GET').toUpperCase(); xhrOptions.url = parameterizeUrl(xhrOptions.url, xhrOptions.data); xhrOptions = bindData(xhrOptions, xhrOptions.data, serialize); xhrOptions.onload = xhrOptions.onerror = function(e) {