--- trunk/html/js/search.js 2004/09/13 14:36:06 17
+++ trunk/html/js/search.js 2004/10/03 21:24:57 18
@@ -83,22 +83,9 @@
{
// return; // Disable debugging
- if(!debug.box)
- {
- debug.box = document.createElement("div");
- debug.box.setAttribute("style",
- "background-color:white" +
- "font-family: monospace; " +
- "border: solid black 3px; "+
- "padding: 10px;");
-
- document.body.appendChild(debug.box);
- debug.box.innerHTML = "
Debugging Output
";
- }
+ var debug_div = document.getElementById('debug');
- var p = document.createElement("p");
- p.appendChild(document.createTextNode(msg));
- debug.box.appendChild(p);
+ if (debug_div) debug_div.innerHTML += msg+"
\n";
}
//
@@ -133,6 +120,8 @@
watchdog_callback(new Array());
}
+var xmldoc;
+
// This function loads the XML document from the specified URL, and when
// it is fully loaded, passes that document and the url to the specified
// handler function. This function works with any XML document
@@ -152,7 +141,7 @@
if (document.implementation && document.implementation.createDocument)
{
// Create a new Document object
- var xmldoc = document.implementation.createDocument("", "", null);
+ xmldoc = document.implementation.createDocument("", "", null);
// Specify what should happen when it finishes loading
xmldoc.onload = function() { handler(xmldoc, url, data, result_handler); }
@@ -167,8 +156,8 @@
// Something about not following standards once again
else if (window.ActiveXObject)
{
- //var xmldoc = new ActiveXObject("MSXML2.DOMDocument"); // Create doc.
- var xmldoc = new ActiveXObject("Microsoft.XMLDOM"); // Create doc.
+ xmldoc = new ActiveXObject("Microsoft.XMLDOM"); // Create doc.
+ if (! xmldoc) xmldoc = new ActiveXObject("MSXML2.DOMDocument"); // Create doc.
// Specify onload
xmldoc.onreadystatechange = function()
{