Skip to content

Commit 58ca676

Browse files
authored
Update README.md
1 parent 942b88f commit 58ca676

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,24 @@ you can also get it from unpkg.com CDN:
5151
https://unpkg.com/sysend
5252
```
5353

54-
or
54+
or jsDelivr:
5555

5656
```
5757
https://cdn.jsdelivr.net/npm/sysend
5858
```
5959

60-
jsDelivr minified the file.
60+
jsDelivr will minify the file. From my testing it's faster then unpkg.com.
6161

6262
## Usage
6363

6464
```javascript
6565
window.onload = function() {
66-
sysend.on('foo', function(message) {
67-
console.log(message);
66+
sysend.on('foo', function(data) {
67+
console.log(data.message);
6868
});
6969
var input = document.getElementsByTagName('input')[0];
7070
document.getElementsByTagName('button')[0].onclick = function() {
71-
sysend.broadcast('foo', {message: input.value});
71+
sysend.broadcast('foo', { message: input.value });
7272
};
7373
};
7474
```
@@ -102,10 +102,10 @@ Open this [demo page](http://jcubic.pl/sysend.php) in two tabs/windows (there is
102102

103103
sysend object:
104104

105-
* `on(name, callback)` - `callback(object, name)` - add event of specified name
106-
* `off(name [, callback])` - remove callback
107-
* `broadcast(name [, object])` - send object and fire all events with specified name (in different pages that register callback using on). You can also just send notification without object
108-
* `proxy(url)` - create iframe proxy for different domain, the targer domain/url should have [proxy.html](https://github.com/jcubic/sysend.js/blob/master/proxy.html) file. If url domain is the same as page domain, it's ignored. So you can put both proxy calls on both domains (new in 1.3.0)
105+
* `on(name, callback)` - `callback(object, name)` - add event handler for specified name.
106+
* `off(name [, callback])` - remove event handler for given name, if callback is not specified it will remove all callbacks for given name.
107+
* `broadcast(name [, object])` - send any object and fire all events with specified name (in different pages that register callback using on). You can also just send notification without an object.
108+
* `proxy(url)` - create iframe proxy for different domain, the target domain/url should have [proxy.html](https://github.com/jcubic/sysend.js/blob/master/proxy.html) file. If url domain is the same as page domain, it's ignored. So you can put both proxy calls on both domains (new in 1.3.0)
109109
* `serializer(to_string, from_string)` - add serializer and deserializer functions (new in 1.4.0)
110110

111111
## License

0 commit comments

Comments
 (0)