azicchetti/jquerymobile-router — pull request #76 by sheppard (2013-05-18 17:40:50+00:00)
Title: restore support for string ui.toPage in pagebeforechange events

Hi,
I see why you disabled support for ui.toPage being a string in pagebeforechange events - but this is actually my primary use case for jQM router. I've been building a custom jQM-based offline-capable web app framework called [wq.app](https://github.com/wq/wq.app). wq.app includes the ability to automatically render and inject pages offline in response to URL changes, via cached JSON objects and interned Mustache templates. My bC callback (`pages.register` / `pages.go` in [pages.js](https://github.com/wq/wq.app/blob/master/js/pages.js)) responds to pagebeforechange events by rendering and injecting pages into the DOM - so I don't need the actual page object in my case (since I know it doesn't exist yet).

I understand that this might be a case for implementing my own pagebeforechange handler, but I really would like to take advantage of jQM router's URL matching capabilities, since I am registering multiple URL-specific callbacks to handle template selection and context generation.

This pull request restores support for string ui.toPage in bC events to jQM router, with the understanding that the page object may not be defined in this case. Since this is somewhat advanced and may not apply to everyone, I added a configuration option to enable this behavior and set it to false by default. I called the new option "bCAllowStringPage", though I'm certainly open to suggestions for a better name.