?
Solved

Why doesn't this XHTML/Javascript page load in FireFox?

Posted on 2009-04-25
10
Medium Priority
?
783 Views
Last Modified: 2013-12-07
Hi Javascript, FireFox Experts
The attached code for a webpage works fine in IE7 but only shows the links (at the bottom) in FireFox.
I suspect there maybe something wrong with the 'browserTest' function, however, I did see an "error msg - 'rt.selectSingleNode' is not a function" (in the "parseXML" function) in the FF error console.  
What needs to change so it renders in FF also?

(I can provide the CSS and XML file if required for viewing.)
Kind regards
2bears
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns = "http://www.w3.org/1999/xhtml">
 
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" media="screen,print" href="./recipe.css" />
 
	<title>Recipe1.html file using Javascript</title>
 
<!-- Locating nodes in Recipe2.xml -->
   <script type = "text/javascript">
   <!--
   	var outputHTML = ""; // stores text to output in outputDiv
	var xmlRecipe=null;
	
	//test for IE or Other Browser
	function browserTest(){
 
	if (window.ActiveXObject){
		// code for IE
		xmlRecipe=new ActiveXObject("Microsoft.XMLDOM");
	}
			else if (document.implementation.createDocument){
				// code for Mozilla, Firefox, Opera, etc.
				xmlRecipe=document.implementation.createDocument("","",null);
	}
					else {
					alert('Your browser cannot handle this script');
	}
 
					if (xmlRecipe!=null){ 
					xmlRecipe.async=false;
					xmlRecipe.load("Recipe1.xml");
	}
		parseXML()
	}
 
   // display the XML document 
   function displayDoc(){
   
      document.getElementById( "outputDiv" ).innerHTML = outputHTML;
	} // end function displayDoc
 
   // obtain and apply XML file
   function parseXML(){
   
		var rt = xmlRecipe.documentElement;
		outputHTML = "";
		if(rt.hasChildNodes) {
			outputHTML = "\<h1\>" + rt.selectSingleNode('title').text + "\<\/h1\>"
			outputHTML += "\<p\>" + rt.selectSingleNode('number_of_servings').text + "\<\/p\>"
			outputHTML += "\<p class='emp'\>" + rt.selectSingleNode('comment').text + "\<\/p\>"
			var ind = rt.selectSingleNode('ingredients')
			if(ind.hasChildNodes) {
				outputHTML += "\<ul\>" 
				outputHTML += "\<li class='heading'\>" +ind.attributes.getNamedItem('heading').nodeValue + "\<\/li\>"
				for(var c = 0;c < ind.childNodes.length;c++) {
					outputHTML += "\<li\>" 
					if(ind.childNodes[c].attributes.getNamedItem('quantity')){
						outputHTML += ind.childNodes[c].attributes.getNamedItem('quantity').nodeValue+ '&nbsp;';
	}
					if(ind.childNodes[c].attributes.getNamedItem('measure')){
						outputHTML += ind.childNodes[c].attributes.getNamedItem('measure').nodeValue + '&nbsp;';
	}
					outputHTML += ind.childNodes[c].text + "\<\/li\>"
	}
					outputHTML += "\<\/ul\>"
	}
			var prep = rt.selectNodes('preparation_instructions')
			if(prep.length>0) {
				for(var p = 0;p < prep.length;p++) {
					outputHTML += "\<p\>" + prep[p].text + "\<\/p\>"
	}
	}
			outputHTML += "\<p\>" + rt.selectSingleNode('cooking_instructions').text + "\<\/p\>"
	}
		displayDoc();
	}
 
-->
   </script>
 
</head>
 
	<body onload="browserTest();">
 
		<div id="outputDiv"></div>
   
		<div class="nav">
			<br />
		<a href="Recipe2.html">Recipe 2, HTML version</a>
			<br /> 
		<a href="Recipe1.xml">Recipe 1, XML version</a>
			<br />
		<a href="Recipe2.xml">Recipe 2, XML version</a> 
 
		</div>
    
	</body>
</html>

Open in new window

0
Comment
Question by:2bears
  • 5
  • 5
10 Comments
 
LVL 10

Expert Comment

by:oleber
ID: 24234847
can you get a xml example of the date
0
 
LVL 10

Expert Comment

by:oleber
ID: 24234878
try to add this code at the begining.
    if ( ! window.ActiveXObject ) {
        Element.prototype.selectNodes = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
                var aNodes = new Array();
                if (oResult != null) {
                    var oElement = oResult.iterateNext();
                    while(oElement) {
                        aNodes.push(oElement);
                        oElement = oResult.iterateNext();
                    }
                }
                return aNodes;
        }
        
        Element.prototype.selectSingleNode = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            if (oResult != null) {
                return oResult.singleNodeValue;
            } else {
                return null;
            }              
        }
    }

Open in new window

0
 

Author Comment

by:2bears
ID: 24235004
Hi olber
Thank you for your reply.
I pasted your code (see attached code snippet)  at the beginning of the script but it had no disernable effect. The files still load ok in IE but not in FireFox.
Have I placed it in the right place?

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns = "http://www.w3.org/1999/xhtml">
 
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" media="screen,print" href="./recipe.css" />
 
	<title>Recipe1.html file using Javascript</title>
 
<!-- Locating nodes in Recipe2.xml -->
   <script type = "text/javascript">
   <!--
 
    if ( ! window.ActiveXObject ) {
        Element.prototype.selectNodes = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
                var aNodes = new Array();
                if (oResult != null) {
                    var oElement = oResult.iterateNext();
                    while(oElement) {
                        aNodes.push(oElement);
                        oElement = oResult.iterateNext();
                    }
                }
                return aNodes;
        }
        
        Element.prototype.selectSingleNode = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            if (oResult != null) {
                return oResult.singleNodeValue;
            } else {
                return null;
            }              
        }
    }
 
 
   	var outputHTML = ""; // stores text to output in outputDiv
	var xmlRecipe=null;
	
	//test for IE or Other Browser
	function browserTest(){
 
	if (window.ActiveXObject){
		// code for IE
		xmlRecipe=new ActiveXObject("Microsoft.XMLDOM");
	}
			else if (document.implementation.createDocument){
				// code for Mozilla, Firefox, Opera, etc.
				xmlRecipe=document.implementation.createDocument("","",null);
	}
					else {
					alert('Your browser cannot handle this script');
	}
 
					if (xmlRecipe!=null){ 
					xmlRecipe.async=false;
					xmlRecipe.load("Recipe1.xml");
	}
		parseXML()
	}
 
   // display the XML document 
   function displayDoc(){
   
      document.getElementById( "outputDiv" ).innerHTML = outputHTML;
	} // end function displayDoc
 
   // obtain and apply XML file
   function parseXML(){
   
		var rt = xmlRecipe.documentElement;
		outputHTML = "";
		if(rt.hasChildNodes) {
			outputHTML = "\<h1\>" + rt.selectSingleNode('title').text + "\<\/h1\>"
			outputHTML += "\<p\>" + rt.selectSingleNode('number_of_servings').text + "\<\/p\>"
			outputHTML += "\<p class='emp'\>" + rt.selectSingleNode('comment').text + "\<\/p\>"
			var ind = rt.selectSingleNode('ingredients')
			if(ind.hasChildNodes) {
				outputHTML += "\<ul\>" 
				outputHTML += "\<li class='heading'\>" +ind.attributes.getNamedItem('heading').nodeValue + "\<\/li\>"
				for(var c = 0;c < ind.childNodes.length;c++) {
					outputHTML += "\<li\>" 
					if(ind.childNodes[c].attributes.getNamedItem('quantity')){
						outputHTML += ind.childNodes[c].attributes.getNamedItem('quantity').nodeValue+ '&nbsp;';
	}
					if(ind.childNodes[c].attributes.getNamedItem('measure')){
						outputHTML += ind.childNodes[c].attributes.getNamedItem('measure').nodeValue + '&nbsp;';
	}
					outputHTML += ind.childNodes[c].text + "\<\/li\>"
	}
					outputHTML += "\<\/ul\>"
	}
			var prep = rt.selectNodes('preparation_instructions')
			if(prep.length>0) {
				for(var p = 0;p < prep.length;p++) {
					outputHTML += "\<p\>" + prep[p].text + "\<\/p\>"
	}
	}
			outputHTML += "\<p\>" + rt.selectSingleNode('cooking_instructions').text + "\<\/p\>"
	}
		displayDoc();
	}
 
-->
   </script>
 
</head>
 
	<body onload="browserTest();">
 
		<div id="outputDiv"></div>
   
		<div class="nav">
			<br />
		<a href="Recipe2.html">Recipe 2, HTML version</a>
			<br /> 
		<a href="Recipe1.xml">Recipe 1, XML version</a>
			<br />
		<a href="Recipe2.xml">Recipe 2, XML version</a> 
 
		</div>
    
	</body>
</html>

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Expert Comment

by:oleber
ID: 24235029
give me one correct Recipe1.xml.

I'will be back from the gymnasium in 3 hours, and I will try to help
0
 

Author Comment

by:2bears
ID: 24235053
Hi oleber
I have attached the Recipe1.xml below.
 I have also included the Recipe.DTD in case you need it.
Thanks
2bears

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type = "text/xsl" href = "Recipe1.xsl"?>
<!-- Recipe1.xml-->
<!DOCTYPE recipe SYSTEM "Recipe.dtd">
<recipe>
	<title created-date="2005-06-01" modified_date="2005-06-01">Pizza Base</title>
	<number_of_servings>Makes enough for one pizza.</number_of_servings>
	<comment>Original recipe.</comment>
	<ingredients heading="Ingredients">
		<ingredient quantity="1" measure="tsp">yeast</ingredient>
		<ingredient quantity="2" measure="tsp">sugar</ingredient>
		<ingredient quantity="0.5" measure="cup">warm water</ingredient>
		<ingredient quantity="1" measure="cup">flour</ingredient>
	</ingredients>
	<preparation_instructions id="1">
        Mix the sugar, yeast and water and leave in a warm
        place for about 10 minutes. Put the flour on the 
        bench and make a well in the centre. Pour the yeast 
        mixture into the well and mix to make a firm dough 
        (add flour or water to adjust consistency). Roll out 
        to make the pizza base.</preparation_instructions>
	<cooking_instructions>
        Part-cook at 180 degC for ten minutes then add toppings
        as required and cook.</cooking_instructions>
</recipe>
 
.........Recipe.DTD..........
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT recipe ((title, number_of_servings, comment, ingredients, preparation_instructions+, cooking_instructions))>
<!ELEMENT title (#PCDATA)>
<!ATTLIST title
	created-date CDATA #IMPLIED
	modified_date CDATA #IMPLIED>
<!ELEMENT number_of_servings (#PCDATA)>
<!ELEMENT comment (#PCDATA)>
<!ELEMENT ingredients ((ingredient+))>
<!ATTLIST ingredients
	heading CDATA #FIXED "Ingredients">
<!ELEMENT ingredient (#PCDATA)>
<!ATTLIST ingredient
	quantity CDATA #REQUIRED
	measure CDATA #IMPLIED>
<!ELEMENT preparation_instructions (#PCDATA)>
<!ATTLIST preparation_instructions
	id CDATA #IMPLIED>
<!ELEMENT cooking_instructions (#PCDATA)>

Open in new window

0
 

Author Comment

by:2bears
ID: 24235075
Hi again oleber
The file you provided fixed the Error for: "selectSingleNode" but a new one for "ind.childNodes[c].attributes is null" on line 90 has appeared - same reason I think.
Rgds 2bears
0
 
LVL 10

Accepted Solution

by:
oleber earned 2000 total points
ID: 24236309
You shall use the DOM defined by W3C. Firefox trys to implement just that.

IE adds allot of garbage around it, making the internet a nightmare.


One advise: first develop to Firefox, after develop to IE. You will win time, allot of time.

Try the code in the snippet
<!-- Locating nodes in Recipe2.xml -->
   <script type = "text/javascript">
   
	
 
    if ( ! window.ActiveXObject ) {
        Element.prototype.selectNodes = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
                var aNodes = new Array();
                if (oResult != null) {
                    var oElement = oResult.iterateNext();
                    while(oElement) {
                        aNodes.push(oElement);
                        oElement = oResult.iterateNext();
                    }
                }
                return aNodes;
        }
        
        Element.prototype.selectSingleNode = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            if (oResult != null) {
                return oResult.singleNodeValue;
            } else {
                return null;
            }              
        }
    }
 
    var outputHTML = ""; // stores text to output in outputDiv
    var xmlRecipe=null;
        
 
    if ( window.ActiveXObject ) {
        Element.prototype.selectNodes = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
                var aNodes = new Array();
                if (oResult != null) {
                    var oElement = oResult.iterateNext();
                    while(oElement) {
                        aNodes.push(oElement);
                        oElement = oResult.iterateNext();
                    }
                }
                return aNodes;
        }
        
        Element.prototype.selectSingleNode = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            if (oResult != null) {
                return oResult.singleNodeValue;
            } else {
                return null;
            }              
        }
    }
        
        
    //test for IE or Other Browser
    function browserTest(){
 
        if (window.ActiveXObject){
            // code for IE
            xmlRecipe=new ActiveXObject("Microsoft.XMLDOM");
        } else if (document.implementation.createDocument){
            // code for Mozilla, Firefox, Opera, etc.
            xmlRecipe=document.implementation.createDocument("","",null);
        } else {
            alert('Your browser cannot handle this script');
        }
        
        if (xmlRecipe!=null){ 
            xmlRecipe.async=false;
            xmlRecipe.load("Recipe1.xml");
        }
        parseXML()
    }
 
   // display the XML document 
   function displayDoc(){
      document.getElementById( "outputDiv" ).innerHTML = outputHTML;
   } // end function displayDoc
 
   // obtain and apply XML file
   function parseXML(){
   
        var rt = xmlRecipe.documentElement;
        outputHTML = "";
        if(rt.hasChildNodes) {
            outputHTML = '<h1>' + rt.selectSingleNode('title').textContent + '</h1>'
            outputHTML += "<p>" + rt.selectSingleNode('number_of_servings').textContent + "</p>"
            outputHTML += "<p class='emp'>" + rt.selectSingleNode('comment').textContent + "</p>"
            var ind = rt.selectSingleNode('ingredients')
            if(ind.hasChildNodes) {
                outputHTML += "<ul>" 
                outputHTML += "<li class='heading'>" +ind.attributes.getNamedItem('heading').nodeValue + "</li>"
                for ( var c = 0; c < ind.childNodes.length; c++) {
                    var myChildNode = ind.childNodes[c];
                    if (myChildNode.nodeType == Node.ELEMENT_NODE ) {
                        outputHTML += "<li>" 
                        if(myChildNode.attributes.getNamedItem('quantity')){
                            outputHTML += myChildNode.attributes.getNamedItem('quantity').nodeValue+ ' ';
                        }
                        if(myChildNode.attributes.getNamedItem('measure')){
                            outputHTML += myChildNode.attributes.getNamedItem('measure').nodeValue + ' ';
                        }
                        outputHTML += myChildNode.textContent + "\<\/li\>"
                    }
                }
                outputHTML += "\<\/ul\>"
            }
            var prep = rt.selectNodes('preparation_instructions')
            if(prep.length>0) {
                for(var p = 0;p < prep.length;p++) {
                    outputHTML += "\<p\>" + prep[p].textContent + "\<\/p\>"
                }
            }
            outputHTML += "\<p\>" + rt.selectSingleNode('cooking_instructions').textContent + "\<\/p\>"
        }
        displayDoc();
    }
 
   </script>

Open in new window

0
 

Author Closing Comment

by:2bears
ID: 31574614
Hi oleber
Thank you for your excellent efforts with this problem.
I wish the Browser manufacturers would get their collective acts together and comply with ONE set of stanards.
Along with all the browser hacks you supplied I also had to duplicate the main javascript function (parseXML() into parseIE() and parseFF() ) to suit both browser's syntax handling.
What a mess.
I have come to the conclusion that it is far more preferable and simple to work in XSL than javascript when dealing with XML.
I have posted the finished code as a comment if you are interested to see what I have done.
I'm sure it could be done more elegantly but I am very new to this.
Many thanks for your solution.

Kind regards
2bears
0
 

Author Comment

by:2bears
ID: 24238806
Hi oleber
This is the final version of the code that worked in both browsers (IE and FF)
Many thanks for your solution.
Rgds
2bears

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns = "http://www.w3.org/1999/xhtml">
 
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" media="screen,print" href="./recipe.css" />
 
	<title>Recipe1.html file using Javascript</title>
 
<!-- Locating nodes in Recipe1.xml -->
   <script type = "text/javascript">
 
<!--
    if ( ! window.ActiveXObject ) {
        Element.prototype.selectNodes = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
                var aNodes = new Array();
                if (oResult != null) {
                    var oElement = oResult.iterateNext();
                    while(oElement) {
                        aNodes.push(oElement);
                        oElement = oResult.iterateNext();
                    }
                }
                return aNodes;
        }
        
        Element.prototype.selectSingleNode = function(sXPath) {
            var oEvaluator = new XPathEvaluator();
            var oResult = oEvaluator.evaluate(sXPath, this, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
            if (oResult != null) {
                return oResult.singleNodeValue;
            } else {
                return null;
            }              
        }
    }
 
 
   	var outputHTML = ""; // stores text to output in outputDiv
	var xmlRecipe=null;
	
	//test for IE or Other Browser
	function browserTest(){
 
	if (window.ActiveXObject){
		// code for IE
		xmlRecipe=new ActiveXObject("Microsoft.XMLDOM");
	}
			else if (document.implementation.createDocument){
				// code for Mozilla, Firefox, Opera, etc.
				xmlRecipe=document.implementation.createDocument("","",null);
	}
					else {
					alert('Your browser cannot handle this script');
	}
					if (xmlRecipe!=null){ 
					xmlRecipe.async=false;
					xmlRecipe.load("Recipe1.xml");
	}
		loadBrowser()
	}
 
   // display the XML document 
   function displayDoc(){
   
      document.getElementById( "outputDiv" ).innerHTML = outputHTML;
	} // end function displayDoc
 
//redirect test for IE or FF
	function loadBrowser(){
 
	if (window.ActiveXObject){
		// code for IE
		parseIE()
	}
			else if (document.implementation.createDocument){
				// code for Mozilla, Firefox, Opera, etc.
				parseFF()
	}
					else {
					alert('Your browser cannot handle this script');
	}			
	} // end function loadBrowser
 
   // obtain and apply XML file in Internet Explorer
   function parseIE(){
   
		var rt = xmlRecipe.documentElement;
		outputHTML = "";
 
		if(rt.hasChildNodes) {
			outputHTML = "\<h1\>" + rt.selectSingleNode('title').text + "\<\/h1\>"
			outputHTML += "\<p\>" + rt.selectSingleNode('number_of_servings').text + "\<\/p\>"
			outputHTML += "\<p class='emp'\>" + rt.selectSingleNode('comment').text + "\<\/p\>"
			var ind = rt.selectSingleNode('ingredients')
			if(ind.hasChildNodes) {
				outputHTML += "\<ul\>" 
				outputHTML += "\<li class='heading'\>" +ind.attributes.getNamedItem('heading').nodeValue + "\<\/li\>"
				for(var c = 0;c < ind.childNodes.length;c++) {
					outputHTML += "\<li\>" 
					if(ind.childNodes[c].attributes.getNamedItem('quantity')){
						outputHTML += ind.childNodes[c].attributes.getNamedItem('quantity').nodeValue+ '&nbsp;';
	}
					if(ind.childNodes[c].attributes.getNamedItem('measure')){
						outputHTML += ind.childNodes[c].attributes.getNamedItem('measure').nodeValue + '&nbsp;';
	}
					outputHTML += ind.childNodes[c].text + "\<\/li\>"
	}
					outputHTML += "\<\/ul\>"
	}
			var prep = rt.selectNodes('preparation_instructions')
			if(prep.length>0) {
				for(var p = 0;p < prep.length;p++) {
					outputHTML += "\<p\>" + prep[p].text + "\<\/p\>"
	}
	}
			outputHTML += "\<p\>" + rt.selectSingleNode('cooking_instructions').text + "\<\/p\>"
	}
		displayDoc();
	}
   // end of function parseIE
 
   // obtain and apply XML file in FireFox
   function parseFF(){
   
        var rt = xmlRecipe.documentElement;
        outputHTML = "";
        if(rt.hasChildNodes) {
            outputHTML = '<h1>' + rt.selectSingleNode('title').textContent + '</h1>'
            outputHTML += "<p>" + rt.selectSingleNode('number_of_servings').textContent + "</p>"
            outputHTML += "<p class='emp'>" + rt.selectSingleNode('comment').textContent + "</p>"
            var ind = rt.selectSingleNode('ingredients')
            if(ind.hasChildNodes) {
                outputHTML += "<ul>" 
                outputHTML += "<li class='heading'>" +ind.attributes.getNamedItem('heading').nodeValue + "</li>"
                for ( var c = 0; c < ind.childNodes.length; c++) {
                    var myChildNode = ind.childNodes[c];
                    if (myChildNode.nodeType == Node.ELEMENT_NODE ) {
                        outputHTML += "<li>" 
                        if(myChildNode.attributes.getNamedItem('quantity')){
                            outputHTML += myChildNode.attributes.getNamedItem('quantity').nodeValue+ ' ';
                        }
                        if(myChildNode.attributes.getNamedItem('measure')){
                            outputHTML += myChildNode.attributes.getNamedItem('measure').nodeValue + ' ';
                        }
                        outputHTML += myChildNode.textContent + "\<\/li\>"
                    }
                }
                outputHTML += "\<\/ul\>"
            }
            var prep = rt.selectNodes('preparation_instructions')
            if(prep.length>0) {
                for(var p = 0;p < prep.length;p++) {
                    outputHTML += "\<p\>" + prep[p].textContent + "\<\/p\>"
                }
            }
            outputHTML += "\<p\>" + rt.selectSingleNode('cooking_instructions').textContent + "\<\/p\>"
        }
        displayDoc();
    }
 
-->
   </script>
 
 
</head>
 
	<body onload="browserTest();">
 
		<div id="outputDiv"></div>
   
		<div class="nav">
			<br />
		<a href="Recipe2.html">Recipe 2, HTML version</a>
			<br /> 
		<a href="Recipe1.xml">Recipe 1, XML version</a>
			<br />
		<a href="Recipe2.xml">Recipe 2, XML version</a> 
 
		</div>
    
	</body>
</html>

Open in new window

0
 
LVL 10

Expert Comment

by:oleber
ID: 24239364
The is already a standard, the W3C one that Firefox tries to follow.

Microsoft, as always, tries to use there position to control the web. Since the IE is losing space and becoming too near of Firefox in the number of users, they are trying to be more standard. But they add some more not standard features to make the life harder to the other.

I would always develop first to Firefox, because:
 - It's more Standard complient
 - it has allot of free plugins that help in the web development
 - Firefox don't add new features

After having Firefox working, try the other ones.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Following on from our article on "The Murky World of Consent and opt in", we thought we would issue some helpful guidance, not only on consent itself but knowing what information you are capturing, what you are doing with this data and how you can p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question