JSFiddle - React, Tailwind, and code Playground

by Florian Ferbach

HTML

<script src="http://ajax.aspnetcdn.com/ajax/signalr/jquery.signalr-2.1.0.js"></script>
<script src="http://localhost:8080/signalr/hubs"></script>
<input type="button" id="test"/>

JavaScript

$(function () {
        //Set the hubs URL for the connection
            $.connection.hub.url = "http://localhost:8080/signalr";
            
            // Declare a proxy to reference the hub.
            var hub = $.connection.switchHub;
            
            // Create a function that the hub can call to broadcast messages.
            hub.client.send = function () {
                console.log(arguments);
            };
     
             // Start the connection.
            $.connection.hub.start().done(function () {
                $('#test').click(function () {
                    // Call the Send method on the hub.
                    chat.server.Handle({
                        Plugin : 'AT288',
                        Action : 'Scan',
                        MinMajor: 1
                    });
                });
            });
        });