--- trunk2/out/js/search.js 2004/07/21 16:45:47 391
+++ trunk2/out/js/search.js 2004/09/23 17:14:33 464
@@ -81,24 +81,11 @@
*/
function debug(msg)
{
- return; // Disable debugging
+// 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 = element_id('debug');
- var p = document.createElement("p");
- p.appendChild(document.createTextNode(msg));
- debug.box.appendChild(p);
+ if (debug_div) debug_div.innerHTML += msg+"
\n";
}
//
@@ -148,11 +135,12 @@
try
{
+ var xmldoc;
// Use the standard DOM Level 2 technique, if it is supported
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 +155,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()
{