-/* $Id: search.js,v 1.12 2007-01-10 11:41:34 sondberg Exp $
+/* $Id: search.js,v 1.15 2007-01-10 12:20:51 sondberg Exp $
* ---------------------------------------------------
* Javascript container
*/
}
+function clear_cell (cell) {
+ while (cell.hasChildNodes())
+ cell.removeChild(cell.firstChild);
+}
+
+
function show_records()
{
if (xshow.readyState != 4)
var xml = xshow.responseXML;
var body = document.getElementById("body");
var hits = xml.getElementsByTagName("hit");
-
- body.innerHTML = '';
+
+ clear_cell(body);
if (!hits[0]) // We should never get here with blocking operations
{
if (namen[0])
var refine_cell = create_element('a',
namen[0].childNodes[0].nodeValue);
- refine_cell.setAttribute('href', '#hejsa');
+ refine_cell.setAttribute('href', '#');
refine_cell.setAttribute('onclick', 'refine_query(this)');
body.appendChild(refine_cell);
-
- /*
- body.innerHTML += '<a href="#" onclick="refine_query(this)">' +
- namen[0].childNodes[0].nodeValue +
- '</a>';
- */
}
if (clients > 0)
xsearch.onreadystatechange=search_started;
xsearch.open("GET", url);
xsearch.send(null);
-// document.getElementById("termlist").innerHTML = '';
document.getElementById("body").innerHTML = '';
update_history();
shown = 0;