lhorie/mithril.js — pull request #153 by jon49 (2014-07-09 22:08:06+00:00)
Title: fixed routing issue when no 'HTML' or 'BODY' tags are available.

When experimenting with routing I noticed that you need `HTML` and `BODY` tags so using the [`johndoe` routing example](http://lhorie.github.io/mithril/mithril.route.html#defining-routes) I found the problem. `window.document.documentElement` is `null`. Which doesn't allow the `replaceChild` method to work properly.

I only tested on the example code as I wasn't sure how your tests worked.

So the below code didn't work before but with the PR it should work now:

```javascript

```

The original error in the console was:

`Uncaught NotFoundError: Failed to execute 'replaceChild' on 'Node': The node to be replaced is null.`