arianhojat Posted August 31, 2007 Share Posted August 31, 2007 I was trying to debug this error and i coulda swore i used childNodes[0] many times be4 without it failing. but the code is rather simple so childNodes is probably the problem... i am looking at this xml in my response var... <info><isDirector>false</isDirector></info> When my js code gets executed and arrives at this line it automatically quits... var isDirector = response.getElementsByTagName('isDirector').childNodes[0].firstChild.nodeValue; Cuts off without any javascript error in FireFox (errrr I really hate DOM errors like that). i noticed however this works... var isDirector = response.getElementsByTagName('isDirector')[0].firstChild.nodeValue; i assumed getElementsByTagName returns an array of the html/xml collection and u probably should use childNodes syntax to drop into the xml node, and get its child node and then its text node value. Why should the array syntax be working better than the more appropriate xml syntax to get the child node? thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.