defunkt/jquery-pjax — pull request #188 by josh (2012-09-10 22:52:32+00:00)
Title: Flip $.fn.pjax container and selector param position

The current `$.fn.pjax` param signature makes since the old `$.fn.live` world. Now that api is deprecated we should rethink `$.fn.pjax`.

Oversimplified, `$.fn.on` flip the matching selector from the jquery context to the first argument. A delegation container is now require where `$.fn.live` assumed `document`.

``` js
$('a').pjax()
// becomes
$(document).pjax('a')
```

Yes, the trivial case is slightly longer. Here you get the chance to specify a delegation container, which is a handy feature. Since this delegation container is now a required param, I think it makes sense to default it as the pjax container.

``` js
$('a').pjax('#main')
// becomes
$(document).pjax('a', '#main')
// or
$('#main').pjax('a')
```

The last example will use the same delegation container and replacement container.

/cc @defunkt