File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -74,25 +74,14 @@ Triggered right after the `hit` event. Indicating that the next page will be loa
74
74
75
75
> pageIndex is zero indexed. This means the index starts at 0 on the first page.
76
76
77
- For example to get the url and title of the new page, you can do:
77
+ For example to notify the user about loading the next page, you can do:
78
78
79
79
``` js
80
80
ias .on (' next' , function (event ) {
81
- // fallback on url and title of current page
82
- let url = document .location .toString ();
83
- let title = document .title ;
84
-
85
- const onLoaded = (event ) => {
86
- url = event .url ;
87
- title = event .xhr .response ? .title ?? title;
88
- }
89
-
90
- ias .once (' loaded' , onLoaded)
81
+ alert (` Page ${ event .pageIndex + 1 } is loading...` );
91
82
92
83
event .promise .then (function () {
93
- alert (` We just loaded ${ url} with title ${ title} ` )
94
-
95
- ias .off (' loaded' , onLoaded);
84
+ alert (` Page ${ event .pageIndex + 1 } is loaded and added to the page.` );
96
85
});
97
86
});
98
87
```
You can’t perform that action at this time.
0 commit comments