1 回答
TA贡献1946条经验 获得超3个赞
$.getScript(settingSignalRServerPath + "/hubs", function () {
$.connection.hub.url = settingSignalRServerPath;
// Declare a proxy to reference the hub.
simpleHubProxy = $.connection.notifyHub;
//Register to the "updateClient" callback method of the hub
//This method is invoked by the hub
simpleHubProxy.client.updateClient = function (gInfo) {
checkTransactionAndRedirectToMerchant(gInfo);
}
$.connection.hub.start()
.done(function () {
var uid = '12345';
$.connection.notifyHub.server.registerInHub(uid);
})
.fail(function () {
console.log('creating conn failed')
});
});
最后我做到了。您可以将整个代码复制到在回调中调用的方法:D
添加回答
举报