signalr client hub events not being triggered within a jquery .ready() method

限于喜欢 提交于 2019-12-06 10:11:55

问题


I have found that the function within a signalr client hub method is not always triggered when enclosed within a jquery .ready() method. For example this does not always work:

$(function(){
hubname.client.methodName = function () {
//do something
}
})

whereas the following works reliably:

hubname.client.methodName = function () {
    //do something
    }

can anyone explain this to me? This pattern of behaviour is not constant, and occurs for me in both chrome and internet explorer.

来源:https://stackoverflow.com/questions/45925309/signalr-client-hub-events-not-being-triggered-within-a-jquery-ready-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!