[Pkg-javascript-commits] [sockjs-client] 26/350: README cleanup from @devinrhode2
tonnerre at ancient-solutions.com
tonnerre at ancient-solutions.com
Fri Aug 5 01:03:38 UTC 2016
This is an automated email from the git hooks/post-receive script.
tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.
commit fc51ad05bc7e606ce94786e29a3fab14cfba4529
Author: Bryce Kahle <bryce.kahle at mlssoccer.com>
Date: Thu May 1 11:39:49 2014 -0400
README cleanup from @devinrhode2
---
README.md | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index 8aa125b..48e6560 100644
--- a/README.md
+++ b/README.md
@@ -86,25 +86,24 @@ but instead of `WebSocket` there is a `SockJS` Javascript object.
First, you need to load SockJS JavaScript library, for example you can
put that in your html head:
- <script src="http://cdn.sockjs.org/sockjs-0.3.min.js">
- </script>
+```html
+<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
+```
After the script is loaded you can establish a connection with the
SockJS server. Here's a simple example:
```javascript
-<script>
- var sock = new SockJS('http://mydomain.com/my_prefix');
- sock.onopen = function() {
- console.log('open');
- };
- sock.onmessage = function(e) {
- console.log('message', e.data);
- };
- sock.onclose = function() {
- console.log('close');
- };
-</script>
+ var sock = new SockJS('http://mydomain.com/my_prefix');
+ sock.onopen = function() {
+ console.log('open');
+ };
+ sock.onmessage = function(e) {
+ console.log('message', e.data);
+ };
+ sock.onclose = function() {
+ console.log('close');
+ };
```
SockJS-client API
@@ -252,15 +251,17 @@ In order to utilize best performance you should use the SockJS-client
releases hosted on SockJS CDN. You should use a version of sockjs-client
that supports the protocol used by your server. For example:
- <script src="http://cdn.sockjs.org/sockjs-0.3.min.js">
- </script>
+```html
+<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script>
+```
A list of files hosted on a CDN is available here: http://sockjs.github.com/sockjs-client/ .
You can also use our CDN via https (using Cloud Front domain name):
- <script src="https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.js">
- </script>
+```html
+<script src="https://d1fxtkz8shb9d2.cloudfront.net/sockjs-0.3.js"></script>
+```
For server-side deployment tricks, especially about load balancing and
session stickiness, take a look at the
@@ -316,6 +317,8 @@ At that point you should have two web servers running: sockjs-node on
[http://localhost:8080/](http://localhost:8080/) you should be able
run the QUnit tests against your sockjs-node server.
+#### Testing Hiccups
+
If you look at your browser console you will see warnings like that:
Incompatibile SockJS! Main site uses: "a", the iframe: "b".
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git
More information about the Pkg-javascript-commits
mailing list