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