I've got an image, when I mouse over it a popup window shows and the person's hobbies are displayed using a CSS popup window. It works in IE, but not Firefox. Any idea why? (lines 23-31)
Code:
<img name=showHobbies src="" style="position:absolute;left:550;top:25;width:100;height:50" onmouseover="show(fullfile)" onmouseout="hide()">
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);
// alert(xmlDoc2);
var x = xmlDoc2.getElementsByTagName("hobbies")[0].firstChild.nodeValue;
var name = xmlDoc2.getElementsByTagName("first")[0].firstChild.nodeValue;
//alert(x);
document.getElementById("popup").innerHTML=x;
//document.getElementById("popup").innerHTML="blah blah blah";
//myXMLHTTPRequest = new XMLHttpRequest();
//myXMLHTTPRequest.open("GET", dataSource, false);
//myXMLHTTPRequest.send(null);
//var xmlDoc = myXMLHTTPRequest.responseXML;
//var stringHobby = xmlDoc.documentElement.lastChild.firstChild.nodeValue;
// var name = xmlDoc.getElementsByTagName("first")[0].firstChild.nodeValue;
//document.getElementById("popup").innerHTML = name + "'s hobbies:\n" + stringHobby;
}
var popwin = document.getElementById("popup");
popwin.style.visibility="visible";
}
function hide()
{
var popwin = document.getElementById("popup");
popwin.style.visibility="hidden";
}
Comment