How to connect to a SignalR hub from PhoneGap or Apache Cordova

<script type="text/javascript">
    $(function () {
        $.connection.hub.url = "http://jgough/SignalR/signalr";

        // Grab the hub by name, the same name as specified on the server
        var chat = $.connection.chat;

        chat.addMessage = function (message) {
            $('#chatMessages').append('<li>' + message + '</li>');
        };

        $.connection.hub.start({ jsonp: true });

        $("#sendChatMessage").click(function () {
            var message = $("#chatMessage").val();
            console.log("Message: " + message);
            chat.send(message);
        });
    });
</script>

References
http://stackoverflow.com/questions/16501590/how-to-connect-to-a-signalr-hub-from-phonegap-app-on-ios