Created
June 13, 2012 18:18
-
-
Save davidfowl/2925621 to your computer and use it in GitHub Desktop.
Connection initialization in multiple pages
This file contains 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
// --- outside of the user controls, e.g. on the container page --- | |
$(function() { | |
window.hubReady = $.connection.hub.start(); | |
}); | |
// --- in your other pages --- | |
$(function() { | |
window.hubReady.done(function() { | |
// call hub method | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment