Master Yoda
Master Yoda

Reputation: 4412

Signalr polling issue with Internet Explorer 9 and ForeverFrames

I use Signalr to show real time updates of long processes happening on the server.

The idea is that the user can see how many items have been processed out of a set amount.

An AJAX post request sends the call to the server to start the process through a controller, at the end of this a partial view is returned and the container element is populated with this result.

$("body").on("click", "#process-button", function ()
{
    var hub = $.connection.myHub;

    $.connection.hub.start().done(function ()
    {
        connectionId = $.connection.hub.id;

        $.ajax({
            type: "POST",
            url: "StartProcess/MyController"+ "&connectionId=" + connectionId,
            cache: false,
            success: function (data) {
                $(".modal #container").empty();
                $(".modal #container").html(data);
            }
        })
    });


    hub.client.sendMessage = function (message) {
        $(".modal #container").empty();
        $(".modal #container").append(message);
    }
});

I cant show the controller ActionResult method for legal reasons but im 100% sure the problem is in the above code. I just cant figure out why.

Ive tested this in Chrome, Firefox, IE10,11 and edge all fine (presumably cos they use websockets) but on IE9 which is using ForeverFrames the process is stalling.

Its worth noting that I tested IE9 using the document mode emulator through IE11.

Here is the output from the network trace.

enter image description here

Excuse the blacked out entries, trying not to broadcast the code.

As you can i have highlighted where the request simply stalls and to my knowledge the partial view is not returned because of this.

Anyone encountered this before?

Upvotes: 2

Views: 200

Answers (1)

Lud
Lud

Reputation: 510

You can try adding

$.connection.hub.start({ transport: ['webSockets', 'serverSentEvents', 'longPolling'] });

To your script to disallow the use of ForeverFrames.

Upvotes: 1

Related Questions