]>
jfr.im git - irc/quakenet/qwebirc.git/blob - static/js/jslib.js
11b7c70c598312c27dccb97c13084372fd5ec6fc
1 if( typeof XMLHttpRequest
== "undefined" ) XMLHttpRequest = function() {
2 try{ return new ActiveXObject("Msxml2.XMLHTTP.6.0") }catch(e
){}
3 try{ return new ActiveXObject("Msxml2.XMLHTTP.3.0") }catch(e
){}
4 try{ return new ActiveXObject("Msxml2.XMLHTTP") }catch(e
){}
5 try{ return new ActiveXObject("Microsoft.XMLHTTP") }catch(e
){}
6 throw new Error("This browser does not support XMLHttpRequest or XMLHTTP.")
9 function jsdecode(data
) {
10 return eval('(' + data
+ ')');
13 function XHR(url
, fn
) {
14 var r
= new XMLHttpRequest();
15 r
.onreadystatechange = function() {
16 if(r
.readyState
== 4 && r
.status
== 200) {
17 var o
= jsdecode(r
.responseText
);
21 r
.open("GET", url
, true);
34 return p
[p
.length
+ d
];
39 var forEach = function(x
, fn
) {
40 for(var i
=0;i
<x
.length
;i
++)