User:Bkkbrad/lang.js

queryUrl="http://en.wikipedia.org/w/query.php"; function interlang {

var the_object; var http_request = new XMLHttpRequest; http_request.open("GET", queryUrl + "?what=langlinks&format=json&titles=" + escape(wgPageName), true); http_request.onreadystatechange = function { if (http_request.readyState == 4) { if (http_request.status == 200) { the_object = eval("(" + http_request.responseText + ")"); } else { alert("There was a problem with the URL."); }       http_request = null; } }; http_request.send(null); } addOnloadHook(interlang);