locked
SignalR : Under IE11, messages can't be received by client untill I hit F12 !!!! but it is working fine on firefox and chrome RRS feed

  • Question

  • User110647115 posted

    Javascript code is given below - 

    <div class="tab-content">
    <div class="twit" id="messagesTable">
    </div>
    </div>

    <script src="/Scripts/jquery.signalR-2.2.0.js"></script>
    <!--Reference the autogenerated SignalR hub script. -->
    <script src="/signalr/hubs"></script>
    <script type="text/javascript">
    $(function () {
    // Declare a proxy to reference the hub.
    var notifications = $.connection.messagesHub;
    $.connection.hub.logging = true;

    //alert('hii');
    //debugger;
    // Create a function that the hub can call to broadcast messages.
    notifications.client.updateMessages = function () {
    getAllMessages()

    };
    // Start the connection.
    $.connection.hub.start().done(function () {
    //alert("connection started")
    getAllMessages();
    }).fail(function (e) {
    alert(e);
    });

    });


    function getAllMessages() {
    var tbl = $('#messagesTable');
    $.ajax({
    url: '/Activity/GetGlobalActivityList',
    contentType: 'application/html ; charset:utf-8',
    type: 'GET',
    dataType: 'html'
    }).success(function (result) {
    tbl.empty().append(result);
    }).error(function () {

    });
    }
    </script>

    Monday, September 28, 2015 6:50 AM

Answers

  • User61956409 posted

    Hi amiiverma,

    Welcome to ASP.NET forum.

    You could try to set cache option of jQuery ajax to false. It will force requested pages not to be cached by the browser.

    $.ajax({
        //...
        cache: false,
        //other options
    });
    

    This link discussed a similar issue, please refer to it.

    http://stackoverflow.com/questions/31251720/ie-11-signalr-not-working

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 29, 2015 1:38 AM
  • User110647115 posted

    Thanks Fei Han.... Now its working fine with 

    cache: false,
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 29, 2015 10:22 AM

All replies

  • User61956409 posted

    Hi amiiverma,

    Welcome to ASP.NET forum.

    You could try to set cache option of jQuery ajax to false. It will force requested pages not to be cached by the browser.

    $.ajax({
        //...
        cache: false,
        //other options
    });
    

    This link discussed a similar issue, please refer to it.

    http://stackoverflow.com/questions/31251720/ie-11-signalr-not-working

    Best Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 29, 2015 1:38 AM
  • User110647115 posted

    Thanks Fei Han.... Now its working fine with 

    cache: false,
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 29, 2015 10:22 AM
  • User110647115 posted

    Thanks Fei Han...

    1 more issue related to same, 

    I tried to use same code on master page or layout page... it is not working there...

    Tuesday, September 29, 2015 10:26 AM