locked
SignalR sending not working on FireFox RRS feed

  • Question

  • User1853342071 posted

    I got strange error for using SignalR on Firefox.

    I create signalr Hub and I write javascript code for sending data to Hub.

    my application is working on IE7+ and Chrome browser.

    But not working on Firefox browser. I don't know yet why?

    my sample code is follows;

    SignalR Hub

    [HubName("DisplayHub")]
    public class DisplayHub : Hub
    {
        public void send(string message)
        {
            Clients.All.broadcastMessage(message);
        }
    }

    function sendqueue() {
                var displayHub = $.connection.DisplayHub;
                $.connection.hub.start({ transport: ['webSockets', 'longPolling'] }).done(function () {
                    var data = document.getElementById('ctl00_ContentPlaceHolder1_lbl1').innerText;
                    var message = data.toString();
                    displayHub.server.send(message);
                });
            }

    when I click asp.net button (Send) , I used that script from code behind to invoke javascript script

    ScriptManager.RegisterStartupScript(this, this.GetType(), "sendqueuescript", "sendqueue();", true);

    on the pageload

    $(function () {
                var displayHub = $.connection.DisplayHub;
                $.connection.hub.start().done(function () {
                });
            });

    on the receiving page

    $(function () {
                var displayHub = $.connection.DisplayHub;
                $.connection.hub.start().done(function () {

                });
                displayHub.client.broadcastMessage = function (message) {
                    document.getElementById('txtcalledqueue').value = message;

                };

    });

    that is.

    it is working on IE and Chrome, but not working on FireFox.

    pls help me.

    Thursday, June 26, 2014 5:30 AM

All replies

  • User71929859 posted

    I don't know yet why?

    Invoke developer tools (Press F12) on firefox and see the console for errors.

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

    Try by without specifying transport methods.

    it is working on IE and Chrome, but not working on FireFox.

    Which version of Firefox?

    Thursday, August 14, 2014 9:31 PM
  • User50697239 posted

    I am having the same issue now. Did you figure what was causing it? any pointer/lead?

    Wednesday, June 14, 2017 1:14 PM
  • User1069499270 posted

    Hello, I have the same issue on Firefox 57.0.2, but is working on Edge, Chrome <g class="gr_ gr_84 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" id="84" data-gr-id="84">and</g> Safari on iPhone.

    Monday, December 18, 2017 9:37 PM