This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java script code for mozilla fire fox Not able to Load the xml from servlet