• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java script code for mozilla fire fox Not able to Load the xml from servlet

 
sudhin hs
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
function loadXMLDocs(dname)
{
var xmlDoc;
var moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');


// code for IE
if (window.ActiveXObject)
{
alert("window.ActiveXObject");
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);

}
// code for Mozilla, Firefox, Opera, etc.
//else if (document.implementation && document.implementation.createDocument)
else if(moz)
{
alert("Mozilla, Firefox");
xmlDoc=document.implementation.createDocument("", "", null);
xmlDoc.async=false;
xmlDoc.load(dname);
alert("xmlDoc moz:" +xmlDoc);
return(xmlDoc);
}
else
{
alert('Your browser cannot handle this script');
}

}

dname is the servlet url which bring in the xml. FOr IE it is working but for Mozilla firefox the XML not being loaded from serlet.

Any suggestion or samle code is welcome
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic