« Response to Rosie's blog - a little javascript help | Main | Response to Srikanth's comment, while reviewing MapYourBuddies »

Response to Rosie

Rosie,
Its hard to debug the issue you are having from the code you posted.

My suggestion is, not to do a trial and error method to make a code work or fix a bug (especially true with javascript). You may be lucky one in 10 times, but the rest 9 times you'll end up spending hours debugging your issue and may introduce bugs along the way.Take a clean slate approach and have only the minimum lines of code you need.

You don't need that for-loop until you need to process every occurance of that description, high or low tags. To start with, extract values only from the first occurance (use index 0 in that array you get after you call getElementsByTagName) and make sure it works. Use alerts to pin-point the error. Such a step-by-step approach will keep the focus in the right direction and you also learn along the way

Sorry for not being very specific ....its hard to see few lines of code and tell what the error is. It may not be related to the code you posted at all. Syntactically it appears fine. Post a link in the blog to the xml file you are trying to process. I'll look at it later using firefox.

Archives

Recent Comments