Skip to content

Commit

Permalink
Remove outdated "Legacy API section"
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Mar 13, 2015
1 parent c4945b6 commit 2029cdb
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions README.md
Expand Up @@ -386,38 +386,6 @@ end

Deploying a deploy, bumping the version constant to force clients to do a full reload the next request getting the new layout and assets.

### Legacy API

Pre 1.0 versions used an older style syntax that was analogous to the now deprecated `$.fn.live` api. The current api is based off `$.fn.on`.

``` javascript
$('a[data-pjax]').pjax('#pjax-container')
```

Expanded to

``` javascript
$('a[data-pjax]').live('click', function(event) {
$.pjax.click(event, '#pjax-container')
})
```

The new api

``` javascript
$(document).pjax('a[data-pjax]', '#pjax-container')
```

Which is roughly the same as

``` javascript
$(document).on('click', 'a[data-pjax]', function(event) {
$.pjax.click(event, '#pjax-container')
})
```

**NOTE** The new api gives you control over the delegated element container. `$.fn.live` always bound to `document`. This is what you still want to do most of the time.

## Contributing

```
Expand Down

0 comments on commit 2029cdb

Please sign in to comment.