SignalR使用过程中一定要注意js的引用顺序,否则就会出现$.connection is undefined脚本错误。

MVC4使用SignalR出现$.connection is undefined错误备忘

注意_Layout.cshtml页面。

MVC4使用SignalR出现$.connection is undefined错误备忘

当然也可以不在_Layout.cshtml页面中引用SignalR相关的js。直接在需要的页面引用SignalR,如下所示:

MVC4使用SignalR出现$.connection is undefined错误备忘

这样可以基本上解决脚本的错误问题.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2019-01-11
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2021-11-19
  • 2021-07-17
  • 2021-10-26
  • 2021-10-06
  • 2022-12-23
相关资源
相似解决方案