Index: website/html/selectdb.js =================================================================== --- website/html/selectdb.js (revision 4699) +++ website/html/selectdb.js (working copy) @@ -31,10 +31,7 @@ } } //add an status line - var emptyOpt = document.createElement("option"); - emptyOpt.value = ""; - emptyOpt.text = "loading"; - list.appendChild(emptyOpt); + list.options[list.options.length] = new Option("loading", ""); //now send the request url += "&mode=categories_xml"; var req = get_request_obj(); @@ -68,18 +65,12 @@ } } //add an empty line - var emptyOpt = document.createElement("option"); - emptyOpt.value = ""; - emptyOpt.text = ""; - list.appendChild(emptyOpt); + list.options[list.options.length] = new Option("", ""); //fill with loaded data var cats = xmlDoc.getElementsByTagName("category"); for (var i = 0; i < cats.length; i++) { var cat = cats[i]; - var opt = document.createElement("option"); - opt.value = "" + (i+1); - opt.text = cat.getAttribute("name"); - list.appendChild(opt); + list.options[list.options.length] = new Option(cat.getAttribute("name"), "" + (i+1)); } list.disabled = false; } @@ -100,17 +91,11 @@ //exit if no category to query if (catid == "") { //add an empty line - var emptyOpt = document.createElement("option"); - emptyOpt.value = ""; - emptyOpt.text = ""; - list.appendChild(emptyOpt); + list.options[list.options.length] = new Option("", ""); return; } //add an status line - var emptyOpt = document.createElement("option"); - emptyOpt.value = ""; - emptyOpt.text = "loading"; - list.appendChild(emptyOpt); + list.options[list.options.length] = new Option("loading", ""); //now send the request url += "&mode=xml&catid=" + catid; var req = get_request_obj(); @@ -145,9 +130,7 @@ } //add an empty line var emptyOpt = document.createElement("option"); - emptyOpt.value = ""; - emptyOpt.text = ""; - list.appendChild(emptyOpt); + list.options[list.options.length] = new Option("", ""); //fill with loaded data var dbs = xmlDoc.getElementsByTagName("db"); for (var i = 0; i < dbs.length; i++) { @@ -171,17 +154,14 @@ (is_short ? "yes" : "no") + "," + db.getAttribute("menu") + "," + db.getAttribute("desc") + "," + - (db.hasAttribute("start") ? db.getAttribute("start") : "") + "," + - (db.hasAttribute("end") ? db.getAttribute("end") : ""); + (db.getAttribute("start") ? db.getAttribute("start") : "") + "," + + (db.getAttribute("end") ? db.getAttribute("end") : ""); var cmpdbs = db.getElementsByTagName("cmp_db"); for (var j = 0; j < cmpdbs.length; j++) { var cmpdb = cmpdbs[j]; optvalue += "," + cmpdb.getAttribute("base"); } - var opt = document.createElement("option"); - opt.value = optvalue; - opt.text = opttext; - list.appendChild(opt); + list.options[list.options.length] = new Option(opttext, optvalue); } list.disabled = false; }