XML Parsing Problem in Mozilla firefox

admin

Administrator
Staff member
Hi All,
I'm facing a problem while parsing XML file using javascript parser.It's works fine in IE but no data is displaying when i open my site in mozilla firefox, below is the code which i'm using in our site <!-- m --><a class="postlink" href="http://bestphoneshop.co.uk/nokia_6280.shtml">http://bestphoneshop.co.uk/nokia_6280.shtml</a><!-- m -->

the deals and top deals displaying in bottom is threu XML parsing....
**************CODE**********


function getRS(rootnode, iCurRec, sFieldName)
{
var iField;
var sData;
sData = "";
for (iField = 0 ; iField < rootnode.childNodes.item(iCurRec).childNodes.length ; iField++){
if (rootnode.childNodes.item(iCurRec).childNodes.item(iField).tagName == sFieldName){
if (rootnode.childNodes.item(iCurRec).childNodes.item(iField).childNodes.length > 0){
sData = rootnode.childNodes.item(iCurRec).childNodes.item(iField).childNodes.item(0).text;
}
else {
sData = "_";
}
}
}
if (sData == "#20")
{
sData = " ";
}
return(sData);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
function GetDeal(phoneid)
{
if (window.ActiveXObject)
{
var source1;
source1 = new ActiveXObject("Microsoft.XMLDOM");
source1.async = false;
source1.load("include/deals.asp?handset="+phoneid);
var movies = source1.getElementsByTagName("plan");
var root;
root=source1.documentElement;
}
else if (document.implementation &&
document.implementation.createDocument)
{
var source1;
source1 = document.implementation.createDocument("","",null);
source1.load("include/deals.asp?handset="+phoneid);
var movies = source1.getElementsByTagName("plan");
var root;
root=source1.documentElement;

}
alert(movies.length);
var sT;
sT = "<table width='100%' border='1' cellpadding='0' cellspacing='3' bordercolor='#FFFFFF' bgcolor='#FFF4F5'><tr bgcolor='#FCE2E5'> <td class='tariff'> <div align='center'>Network</div></td><td class='tariff'> <div align='center'>Tariff</div></td><td class='tariff'> <div align='center'>Monthly<br>Line Rental</div></td><td class='tariff'> <div align='center'>Inclusive Minutes </div></td><td class='tariff'> <div align='center'>Inclusive Text</div></td><td class='tariff'> <div align='center'>Handset Cost </div></td><td class='tariff'> <div align='center'>Free Incentive </div></td><td class='tariff'> <div align='center'>Where to BUY </div></td></tr>";

for(var i=0;i<movies.length;i++)
{

sT += "<tr align='center'> <td rowspan='2' class='deals1' align='center'><img src=http://www.webdeveloper.com/forum/archive/index.php/images/"+getRS(root, i, "network")+" border='0'></td><td class='deals1'>"+getRS(root, i, "price")+"</td><td rowspan='2' class='deals1'>&pound;"+getRS(root, i, "Cost")+"</td><td rowspan='2' class='deals2'>"+getRS(root, i, "VoiceCall")+"</td><td rowspan='2' class='deals1'>"+getRS(root, i, "SMS")+"</td><td rowspan='2' class='deals1'>&pound;"+getRS(root, i, "HandsetCost")+"</td><td rowspan='2' class='deals2'>"+getRS(root, i, "BestRetailersDeal")+"</td><td rowspan='2' class='deals1'><A href=http://www.webdeveloper.com/forum/archive/index.php/" + getRS(root, i, "Oururl") + " target='_blank' class='affLink'>"+getRS(root, i, "affname")+"</A></td></tr><tr align='center'><td class='deals1'>"+getRS(root, i, "Contract")+"</td></tr>";

}
sT += "</TABLE>";

document.getElementById("tgtDeal").innerHTML = sT;

}
///function for top deal
function GetTopDeal(phoneid)
{
//alert("Hello");
var source1;
source1 = new ActiveXObject("Microsoft.XMLDOM");
source1.async = false;
source1.load("include/top_deal.asp?handset="+phoneid);
var movies = source1.getElementsByTagName("plan");
//alert(movies.length);
var root;
root=source1.documentElement;
var sT;
sT = "<table width='100%' border='1' cellpadding='0' cellspacing='3' bordercolor='#FFFFFF' bgcolor='#FCE2E5'><tr bgcolor='#FCE2E5'> <td class='tariff'> <div align='center'>Network</div></td><td class='tariff'> <div align='center'>Tariff</div></td><td class='tariff'> <div align='center'>Monthly<br>Line Rental</div></td><td class='tariff'> <div align='center'>Inclusive Minutes </div></td><td class='tariff'> <div align='center'>Inclusive Text</div></td><td class='tariff'> <div align='center'>Handset Cost </div></td><td class='tariff'> <div align='center'>Free Incentive </div></td><td class='tariff'> <div align='center'>Where to BUY </div></td></tr>";

for(var i=0;i<movies.length;i++)
{

sT += "<tr align='center'> <td rowspan='2' class='deals1' align='center'><img src=http://www.webdeveloper.com/forum/archive/index.php/images/"+getRS(root, i, "network")+" border='0'></td><td class='deals1' align='center'>"+getRS(root, i, "price")+"</td><td rowspan='2' class='deals1' align='center'>&pound;"+getRS(root, i, "Cost")+"</td><td rowspan='2' class='deals2' align='center'>"+getRS(root, i, "VoiceCall")+"</td><td rowspan='2' class='deals1' align='center'>"+getRS(root, i, "SMS")+"</td><td rowspan='2' class='deals1' align='center'>&pound;"+getRS(root, i, "HandsetCost")+"</td><td rowspan='2' class='deals2' align='center'>"+getRS(root, i, "BestRetailersDeal")+"</td><td rowspan='2' class='deals1' align='center'><A href=http://www.webdeveloper.com/forum/archive/index.php/" + getRS(root, i, "Oururl") + " target='_blank' class='affLink'>"+getRS(root, i, "affname")+"</A></td></tr><tr><td class='deals1' align='center'>"+getRS(root, i, "Contract")+"</td></tr>";

}
sT += "</TABLE>";

document.getElementById("tgtTopDeal").innerHTML = sT;

}

***********************************

Can any one help me
Thanks in advance
Santosh
 
Back
Top