我正在尝试在Mac OS 10.10.5上使用Xamarin Studio Community 6.1.5运行Getting Started with SignalR 2.0 and MVC 5 sample .
在Firefox和Chrome中,开发人员工具显示 /signalr/hubs
的请求完成并以200响应,但是它们显示的主体不会't contain anything. (Chrome reports a response size and time; Firefox doesn' . )我向 Chat.cshtml
添加了一个 debugger
JavaScript语句,但调试器在Firefox中从不中断当我取消URL /搜索栏旁边的页面加载(即按 [Esc]
或按 Stop loading this page
)按钮时,Chrome中断 .
@section scripts {
<script src="~/Scripts/jquery.signalR-2.0.3.min.js"></script>
<script src="~/signalr/hubs"></script>
<script>
$(function () {
debugger;
// Reference the auto-generated proxy for the hub.
var chat = $.connection.chatHub;
// The rest omitted from the Stack Overflow question for brevity.
});
// This optional function html-encodes messages for display in the page.
function htmlEncode(value) {
var encodedValue = $('<div />').text(value).html();
return encodedValue;
}
</script>
}
该示例适用于Visual Studio .
这个例子应该有效吗?如果它可以使它工作,我需要做什么?