Skip to content

Instantly share code, notes, and snippets.

@NOtherDev NOtherDev/client.html
Last active Aug 29, 2015

What would you like to do?
ShareJS 0.7.3 web client-side code
<!-- see -->
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
<textarea id="pad"></textarea>
<script src="/srv/text.js"></script>
<script src="/srv/share.js"></script>
var getUrlParameter = function (name) {
return (new RegExp(name + '=' + '(.+?)(&|$)').exec(||[,null])[1];
var ws = new WebSocket('ws://');
var share = new sharejs.Connection(ws);
var doc = share.get('docs', getUrlParameter('doc'));
doc.whenReady(function () {
if (!doc.type) {
var elem = document.getElementById('pad');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.