$.connection.hub.start().done(function () { alert('signalR started'); }).fail

var hub = $.connection.myHub;
hub.client.testMessage = function (message) {
    console.log("Test: " + message);
};
$.connection.hub.start().done(function () { 
    alert('signalR started');  
}).fail(function (reason) {
    console.log("SignalR connection failed: " + reason);
});
hub.server.testConnection("hello signalR").done(function () { });
posted @ 2016-12-16 10:19  我是老码农  阅读(1808)  评论(0编辑  收藏  举报