is it possible to implement SignalR without the use of Jquery. I want to create a module for Titanium, but I don't know how dependent SignalR is on the DOM. Is jQuery used just for the ajax request? how hard do you think this would be?
implement signalR without jquery
Um its not impossible but it'll be abit of work. you will basicly need to re-write all jquery syntax ($...) in
Jquery.signalR.js
as regual javascript. Also you will only be able to do low level connections as the "hub" model also requires jquery.
You will probably need to include JSON.js so you can make your ajax call like this.
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);
Yeah I actually had a go at doing this and its not worth it. If for example you copied the implementations in jquery into signalR you basicly end up with about 80% of jquery re-written in SignalR. So it seems kind of pointless as you wont save much in size. soz –
Bourbon
© 2022 - 2024 — McMap. All rights reserved.