3 function Config(protocol, id) {
4 this.protocol = protocol;
8 function getConfigList() {
11 var xhr = new XMLHttpRequest();
12 xhr.open("GET", "configs", false);
15 // If fail, throw error
16 if (xhr.status != 200)
17 throw new Error(xhr.statusText);
19 // Otherwise, get list
20 var configs = new Array();
22 var configElements = xhr.responseXML.getElementsByTagName("config");
23 for (var i=0; i<configElements.length; i++) {
24 configs.push(new Config(
25 configElements[i].getAttribute("protocol"),
26 configElements[i].getAttribute("id")