Brad Jones
September 11th, 2003, 04:03 PM
A piece of ASP code written primarily in JScript is being moved from one server to a new one with idenitical set ups. On the new server, the JScript code is giving an error. The push method is not being recognized as a valid method of the Array object. The chunk of code that is giving an error is:
// This section is used to get all categories dynamically.
var docHeadlines =
objXMLDoc.documentElement.selectNodes("book/CategoryList/cat");
var numNodes,nn;
var aTypes = new Array();
aTypes.push(new Array("--All--",0,""));
numNodes=docHeadlines.length;
var Check=0;
for(var i=0;i<numNodes;i++)
{
nn = docHeadlines.nextNode();
Check = 0;
for(var j=0;j<aTypes.length;j++)
{
if(aTypes[j][0]==nn.text)
{
Check=1;
break;
}
}
if(Check==0)
aTypes.push(new Array (nn.text,aTypes.length,nn.text));
}
// End of Section
The two red lines are the ones giving errors. Any thoughts?
Brad!
// This section is used to get all categories dynamically.
var docHeadlines =
objXMLDoc.documentElement.selectNodes("book/CategoryList/cat");
var numNodes,nn;
var aTypes = new Array();
aTypes.push(new Array("--All--",0,""));
numNodes=docHeadlines.length;
var Check=0;
for(var i=0;i<numNodes;i++)
{
nn = docHeadlines.nextNode();
Check = 0;
for(var j=0;j<aTypes.length;j++)
{
if(aTypes[j][0]==nn.text)
{
Check=1;
break;
}
}
if(Check==0)
aTypes.push(new Array (nn.text,aTypes.length,nn.text));
}
// End of Section
The two red lines are the ones giving errors. Any thoughts?
Brad!