[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 395
  • Last Modified:

loading an XML document using Firefox

i'm trying to load part of an XML document into Firefox and show the information in a CSS popup windox.  it works for IE but not for Firefox.  The code snippets are shown below:  

function show(dataSource)
            {

           
           
            if (window.ActiveXObject) {
           
            var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
            xmlDoc.async = false;
            xmlDoc.load(dataSource);
           
           
           var stringHobby = xmlDoc.documentElement.lastChild.firstChild.nodeValue;
            var name = xmlDoc.getElementsByTagName("first")[0].firstChild.nodeValue;
           document.getElementById("popup").innerHTML = name + "'s hobbies:\n" + stringHobby;
           
            }
           
            else {
           
             xmlDoc2= document.implementation.createDocument("","",null);
             xmlDoc2.load(dataSource);
           
            var x = xmlDoc2.getElementsByTagName("hobbies")[0].firstChild.nodeValue;
            var name = xmlDoc2.getElementsByTagName("first")[0].firstChild.nodeValue;
           
            document.getElementById("popup").innerHTML=x;
           
            }

           
            var popwin = document.getElementById("popup");
            popwin.style.visibility="visible";

         
            }
           
==================================================================

          <img name="showHobbies" src="" style="position:absolute;left:550;top:25;width:100;height:50" onmouseover="show(fullfile)" onmouseout="hide()">
       
        <div align=left style="left:50px">
        <p style="margin-left:100;margin-top:50;color:#FFFFFF;font-family:arial">
            <input type="radio" name="decision" value="interview" />Interview
            <input type="radio" name="decision" value="manager" />to Manager
            <input type="radio" name="decision" value="reject" checked />Reject</p>
        </div>
        </form>                  
          <div id="popup" style="position:absolute;left:600px; top:50px; width:150px; height:70px;"></div>
0
jpking72
Asked:
jpking72
1 Solution
 
Geert BormansCommented:
           xmlDoc2= document.implementation.createDocument("","",null);
             xmlDoc2.async = false;
           xmlDoc2.load(dataSource);
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now