7
if (!window.JSON) {
        // no JSON!
        throw "SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.";
    }

我的 mvc 4 网页使用 signalR Hub 在 Firefox、IE8 和 Chrome 中运行良好,但在 IE7 中出现问题,有人遇到同样的问题吗?

4

1 回答 1

5

从 SignalR 常见问题解答https://github.com/SignalR/SignalR/wiki/Faq

为什么 SignalR 在浏览器 IE6/IE7 中不起作用?

SignalR 需要 JSON 解析器和发送 xhr 请求的能力(用于长轮询)。如果您的浏览器没有,您需要在应用程序中包含 json2.js(SignalR 会抛出一个错误,告诉您也需要它)。你可以在 NuGet 上获得它。

于 2012-06-26T10:34:14.547 回答