Created
November 18, 2012 15:57
-
-
Save vgheri/4105971 to your computer and use it in GitHub Desktop.
Estabilishing a connection to the server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function () { | |
| var username = @Html.Raw(Json.Encode(Model)); | |
| PongR.createInstance(1200,600,username); | |
| PongR.connect(); | |
| }); | |
| pongR.PublicPrototype.connect = function () { | |
| $.connection.hub.start() | |
| .done(function () { | |
| pongR.pongRHub.joined(); // pongRHub is the SignalR object holding connection info | |
| }); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment