Implement signalR without jquery

Is it possible to implement SignalR without using jQuery. I want to create a module for Titanium, but I do not know how the dependent SignalR is in the DOM. Is jQuery used only for ajax request? how do you think it would be?

+5
source share
1 answer

It is not impossible, but it will work. you will need to rewrite all jquery syntax ($ ...) in

Jquery.signalR.js

like regular javascript. You can also make low-level connections, as the hub model also requires jquery.

You probably need to enable JSON.js so you can make your ajax call this way.

var the_object = {}; 
var http_request = new XMLHttpRequest();
http_request.open( "POST", url + "/negotiate, true );
...
http_request.onreadystatechange = function () {
    if ( http_request.readyState == 4 && http_request.status == 200 ) {
            the_object = JSON.parse( http_request.responseText );
        }
};
http_request.send(null);
+2
source

All Articles