browserstate/ajaxify — pull request #23 by gustavnikolaj (2013-10-01 13:44:53+00:00)
Title: Do precise match on menu items if there is more than one matching menu item

I had a problem, where ajaxify would not make my "Homepage" menu item the active menu item.

Take this sample code:

```html

Home

Page 1

Page 2

Page 3

Page 4

```

If you had that on an ajaxified page, and clicked on Page 1, the second li would be .active as expected. If you then click on Home, you would get this result:

```html

Home

Page 1

Page 2

Page 3

Page 4

```

The reason being, that all the li's is matching the following selector, as they all start with a slash and that relativeUrl is an empty string:
```js
...has('a[href^="'+relativeUrl+'"],a[href^="/'+relativeUrl+'"],a[href^="'+url+'"]')
```

Thus, to address this issue, I do a precise match (href= (href equals) instead of href^= (href starts with)) if more than one match is found.

I am not aware of any cases where this change would be a problem. I apologize in advance, should I be mistaken.