在我的应用程序中,导航到另一个页面时发生以下控制台错误。连接尚未完全初始化
Uncaught Error: SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started.
在布局页面中,脚本按以下顺序排列。
@Styles.Render("~/Content/themes/base/jqueryUi")
@Styles.Render("~/Content/customCss")
@Scripts.Render("~/Scripts/jQuery")
@Scripts.Render("~/Scripts/customScripts")
<script src="/signalr/hubs"></script>
var progressHub = $.connection.parallelProcessing;
var flagDownload = true;
$(function() {
progressHub.client.updateProgresssBar = function(progressPercentage, downloadedSize, totalFileSize) {
debugger
downloadProgress("", "", "");
$("#downloading-progress").dialog("open");
var progressObj = $("#progressBar").data("ejProgressBar");
progressObj.option("text", progressPercentage + " %");
progressObj.option("percentage", progressPercentage);
$(".received").html("(" + downloadedSize + " ");
$(".total-size").html("of " + totalFileSize + ")");
flagDownload = true;
if (progressPercentage == 100)
$("#downloading-progress").dialog("close");
};
progressHub.client.noNetConnection = function() {
if (flagDownload) {
flagDownload = false;
showalertdownload("@Message.Nointernetconnection");
}
};
progressHub.client.closeProgressDialog = function() {
$("#downloading-progress").dialog("close");
enableEvents();
};
$.connection.hub.start().done(function() {
});
});
function updateConnectionID() {
progressHub.server.updateConnectionID();
}
请让我知道是否有任何解决方案来解决此问题。提前感谢。
找到你能给你的JavaScript代码调用你的连接/集线器的休息吗? – bsoulier