CameronAskew/jquery.mobile.paramsHandler — pull request #2 by morphatic (2014-04-17 21:19:47+00:00)
Title: updated regex to avoid matching pages with similar names

Hi there,

Excellent little plugin. This functionality should be in the core. Don't know why it's so hard to pass params between pages...

I updated your regex so that it would not match two pages that have similar pages. For example, if your current page structure looks like:

```

...

...

```

and your javascript looks like:

```
$.mobile.paramsHandler.addPage( "dog", [ "id" ], [], showDog );
$.mobile.paramsHandler.init();
```

Then when you transition to the `#dogs` page, the regex for `#dog` matches and the paramsHandler callback gets fired, even though it shouldn't. By looking explicitly for the `?` or end of string, you can avoid that.

Thanks for this plugin!!!
Morgan