Hi all,

I try to use javascript to load xml file. Followings are part of the
code.  (got them from http://www.quirksmode.org/dom/importxml.html). 
I am using Mac, so it can pop out "1" "2" "5". But "6" never shows up.
 Anbody can help me to figure out why I can't load the xml file? Thank
a lot.

Jarry

 

  <head>                         
     <script type="text/javascript">     
                         
     function showkey()
     {       
        if (document.implementation &amp;&amp;
document.implementation.createDocument)
        {
           alert("1");
           xmldoc = document.implementation.createDocument("", "", null);
           alert("2");
        }
        else if (window.ActiveXObject)
        {
           alert("3");
           xmldoc = new ActiveXObject("Microsoft.XMLDOM");       
        }
        else{     
            alert('Your browser can\'t handle this script');
            return;
        }
        
        alert("5"); 
        xmldoc.load("keywords.xml");
               
        alert("6");

        var x = xmldoc.getElementsByTagName("keyword");
        document.show.memm.value= x;             
      }
      </script>
  </head>

  <body>
      <form name="show" onsubmit="return showkey()">         
           <input name="memm" value=""/>
            <input type="submit" value="display" />
      </form>
  </body>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to