Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes HTML, CSS and JavaScript and the fly likes Java script code for mozilla fire fox Not able to Load the xml from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Java script code for mozilla fire fox Not able to Load the xml from servlet" Watch "Java script code for mozilla fire fox Not able to Load the xml from servlet" New topic
Author

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

sudhin hs
Greenhorn

Joined: Nov 29, 2011
Posts: 1
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
 
Have you tried LearnNowOnline? http://www.learnnowonline.com/
 
subject: Java script code for mozilla fire fox Not able to Load the xml from servlet