implement signalR without jquery

血红的双手。 提交于 2019-12-05 08:22:55

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);
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!