Skip to content

Commit 2029cdb

Browse files
committed
Remove outdated "Legacy API section"
1 parent c4945b6 commit 2029cdb

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

README.md

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -386,38 +386,6 @@ end
386386

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

389-
### Legacy API
390-
391-
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`.
392-
393-
``` javascript
394-
$('a[data-pjax]').pjax('#pjax-container')
395-
```
396-
397-
Expanded to
398-
399-
``` javascript
400-
$('a[data-pjax]').live('click', function(event) {
401-
$.pjax.click(event, '#pjax-container')
402-
})
403-
```
404-
405-
The new api
406-
407-
``` javascript
408-
$(document).pjax('a[data-pjax]', '#pjax-container')
409-
```
410-
411-
Which is roughly the same as
412-
413-
``` javascript
414-
$(document).on('click', 'a[data-pjax]', function(event) {
415-
$.pjax.click(event, '#pjax-container')
416-
})
417-
```
418-
419-
**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.
420-
421389
## Contributing
422390

423391
```

0 commit comments

Comments
 (0)