Skip to content

Commit c81f466

Browse files
MaddieM4fieg
authored andcommitted
Update the docs, now that loadEvent is more capable
1 parent 1a934eb commit c81f466

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

doc/events.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@ The load event object contains the following properties.
2424
|-----------|---------------|-------------------------|
2525
| event.url | string | url that will be loaded |
2626

27-
Using this event it is possible to change the requested url. This can be useful to append an arbitrary parameter to the requested url so the server can handle the request differently. For example to optimize the returned html by stripping everything outside the container element (header, footer, etc.).
27+
Using this event it is possible to change the requested url. This can be useful to append an arbitrary parameter to the requested url so the server can handle the request differently. For example to optimize the returned url by stripping everything outside the container element (header, footer, etc.). Because it is used as the settings object in $.get, you can also use this for more exotic configuration.
2828

2929
```javascript
3030
ias.on('load', function(event) {
3131
event.url = event.url + "?ajax=1";
32+
// alternatively...
33+
event.data = { ajax: 1 };
34+
35+
// And as a more exotic example, timeout and HTTP auth
36+
event.timeout = 7000; //ms
37+
event.username = 'shirley';
38+
event.password = 'temple';
3239
})
3340
```
3441

0 commit comments

Comments
 (0)