Create a gist now

Instantly share code, notes, and snippets.

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