Skip to content

Instantly share code, notes, and snippets.

@rcurlette
Last active December 19, 2015 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcurlette/5963773 to your computer and use it in GitHub Desktop.
Save rcurlette/5963773 to your computer and use it in GitHub Desktop.
Signalr4Tridion test page for confirming the Signalr Server, and especially the URL of the server, are working correct.
<html>
<head>
<script src="Scripts/jquery-1.6.4.js" type="text/javascript"></script>
<script src="Scripts/jquery.signalR-1.1.2.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
var connection = $.connection('/channel');
connection.received(function (data) {
$('#messages').prepend('<li>' + data + '</li>');
});
connection.start().done(function () {
$("#broadcast").click(function () {
connection.send($('#msg').val());
});
});
});
</script>
</head>
<!-- Sample Code from https://github.com/SignalR/SignalR/wiki/QuickStart-Persistent-Connections -->
<body>
<form>
<input type="text" id="msg" />
<input type="button" id="broadcast" value="broadcast" />
<ul id="messages">
</ul>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment