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

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

2bearsAsked:
Who is Participating?
 
oleberCommented:
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
 
oleberCommented:
can you get a xml example of the date
0
 
oleberCommented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
2bearsAuthor Commented:
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
 
oleberCommented:
give me one correct Recipe1.xml.

I'will be back from the gymnasium in 3 hours, and I will try to help
0
 
2bearsAuthor Commented:
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
 
2bearsAuthor Commented:
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
 
2bearsAuthor Commented:
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
 
2bearsAuthor Commented:
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
 
oleberCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.