1 回答

TA貢獻(xiàn)1946條經(jīng)驗(yàn) 獲得超3個(gè)贊
$.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')
});
});
最后我做到了。您可以將整個(gè)代碼復(fù)制到在回調(diào)中調(diào)用的方法:D
添加回答
舉報(bào)