简体   繁体   English

SignalR在IE8中不起作用

[英]SignalR not working in IE8

I am working on SignalR. 我正在使用SignalR。 Everything working fine in all browser except IE8. 除了IE8,其他所有浏览器都可以正常工作。 Here is my code. 这是我的代码。

<script src="~/Scripts/jquery.signalR-2.2.0.min.js"></script>
<script src="../../signalr/hubs"></script>

 $(document).ready(function () {
        var templateId = '@Model.TemplateId';
        var importNotifier = $.connection.runImport;
        importNotifier.client.sendMessage = function (data) {
            UpdateChart(data);
        };
        $.connection.hub.start().done(init);
        function init() {
            importNotifier.server.import(templateId, $("#hdnServerName").val(), '@ViewBag.ServerUserName', '@ViewBag.ServerPassword', '@ViewBag.AuthenticationType', '@ViewBag.DatabaseName');
        }
    });

Webpage error details 网页错误详细信息

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3) Timestamp: Tue, 22 Sep 2015 07:39:12 UTC 用户代理:Mozilla / 4.0(兼容; MSIE 8.0; Windows NT 6.1; Trident / 4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4 .0E; InfoPath.3)时间戳:星期二,2015年9月22日07:39:12 UTC

Message: Expected identifier, string or number Line: 88 Char: 13 Code: 0 URI: http://localhost:8092/signalr/hubs 消息:期望的标识符,字符串或数字行:88字符:13代码:0 URI: http:// localhost:8092 / signalr / hubs

Message: Expected identifier Line: 279 Char: 39 Code: 0 URI: http://localhost:8092/Graph/Graph/?TemplateId=27&IsUse=0 消息:期望的标识符行:279字符:39代码:0 URI: http:// localhost:8092 / Graph / Graph /?TemplateId = 27&IsUse = 0

I am not able to understand why it is not working. 我不明白为什么它不起作用。 I tried to insert http://localhost:8092/signalr/hubs to browser and its allow me to download. 我试图将http:// localhost:8092 / signalr / hubs插入浏览器,并允许我下载。

I websockets are not supported in IE8. IE8不支持I websockets。 First version that works with websockets is IE10. 与websockets兼容的第一个版本是IE10。

Here's a list of browsers that support(or not) websockets: http://caniuse.com/#feat=websockets 以下是支持(或不支持)websocket的浏览器列表: http : //caniuse.com/#feat=websockets

I finally resolved issue.I follow following steps 我终于解决了问题。请按照以下步骤操作

  1. uninstall all packages which is required for SignalR. 卸载SignalR所需的所有软件包。
  2. Install again required packages. 再次安装所需的软件包。

I follow this step. 我按照这个步骤。 because I was in impression that may there was some dependency issue. 因为我印象中可能存在一些依赖问题。 Then also my code was not working 然后我的代码也无法正常工作

  1. finally I change my method name "Import" to "InsertingData" 最后,我将方法名称“导入”更改为“ InsertingData”

and its working now. 及其现在的工作。 So I can not conclude here that only name creates any problem (may be import is keyword in ie8) or there is some issue with dependency also. 因此,我不能在这里得出结论,只有名称会引起任何问题(可能是ie8中的import是关键字)或依赖关系也存在一些问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM