Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript Object Detection

Status
Not open for further replies.

simonchristieis

Programmer
Joined
Jan 10, 2002
Messages
1,144
Location
GB

I have created an array from the results returned by a selectNodes statement.

This information is used to create a menu.

Everything is working ok except for the line detecting whether there is anymore information to display.

This line is
Code:
while(!tXml[x].item(ii)){
x--;ii = tXml[0][x];
}

where
tXml[x] is the nodes collection object

and

.item(ii) is a node


The code appears to be failing because there is no node at the location (tXml[x].item(ii)).

Is there any other way that I can detect whether the location is a node / object ?

Any ideas anyone ?

Simon
 

Nott sure this is what you're after, but you can test if something is an object with
Code:
if( typeof obj == "object" )
 
Good try - but didn't work - Ive used a getaround

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top