# ARRAY Experts ,please help

**URL:** <https://forum.kirupa.com/t/array-experts-please-help/73382>\
**Category:** Uncategorized\
**Created:** [December 15, 2004, 8:39pm UTC](https://forum.kirupa.com/t/array-experts-please-help/73382 "2004-12-15T20:39:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![orionstar](https://avatars.discourse-cdn.com/v4/letter/o/51bf81/32.png) [@orionstar](https://forum.kirupa.com/u/orionstar)\
**Post date:** [December 15, 2004, 8:39pm UTC](https://forum.kirupa.com/t/array-experts-please-help/73382/1 "2004-12-15T20:39:18Z")

</div>

Hello,

How can I code this so I can just use an array to have the function load info from an xml page, instead of having to tediously re-write each line and increment the number?  
These are just 6 lines of data and I need to add 40 more.

Thanks in advance.

function loadXML(loaded) {  
if (loaded) {  
\_root.menu1.linkname = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;  
\_root.menu1.link = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link2[/color]](javascript:golink(2))name = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link2[/color]](javascript:golink(2)) = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link3[/color]](javascript:golink(3))name = this.firstChild.childNodes[0].childNodes[4].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link3[/color]](javascript:golink(3)) = this.firstChild.childNodes[0].childNodes[5].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link4[/color]](javascript:golink(4))name = this.firstChild.childNodes[0].childNodes[6].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link4[/color]](javascript:golink(4)) = this.firstChild.childNodes[0].childNodes[7].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link5[/color]](javascript:golink(5))name = this.firstChild.childNodes[0].childNodes[8].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link5[/color]](javascript:golink(5)) = this.firstChild.childNodes[0].childNodes[9].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link6[/color]](javascript:golink(6))name = this.firstChild.childNodes[0].childNodes[10].firstChild.nodeValue;  
\_root.menu1.[[color=#0000ff]Link6[/color]](javascript:golink(6)) = this.firstChild.childNodes[0].childNodes[11].firstChild.nodeValue;  
\_root.menu1.link\_txt.htmlText = “\<a href=’”+ \_root.menu1.link+ “’\>\<b\>”+ \_root.menu1.linkname +"\</b\>\</a\>";  
\_root.menu1.[[color=#0000ff]Link2[/color]\_txt.htmlText = “\<a href=’”+ \_root.menu1.[url=“javascript:golink(2)”][color=#0000ff]Link2[/color]+ “’\>\<b\>”+ \_root.menu1.[url=“javascript:golink(2)”][color=#0000ff]Link2[/color]](javascript:golink(2))name +"\</b\>\</a\>";  
\_root.menu1.[[color=#0000ff]Link3[/color]\_txt.htmlText = “\<a href=’”+ \_root.menu1.[url=“javascript:golink(3)”][color=#0000ff]Link3[/color]+ “’\>\<b\>”+ \_root.menu1.[url=“javascript:golink(3)”][color=#0000ff]Link3[/color]](javascript:golink(3))name +"\</b\>\</a\>";  
\_root.menu1.[[color=#0000ff]Link4[/color]\_txt.htmlText = “\<a href=’”+ \_root.menu1.[url=“javascript:golink(4)”][color=#0000ff]Link4[/color]+ “’\>\<b\>”+ \_root.menu1.[url=“javascript:golink(4)”][color=#0000ff]Link4[/color]](javascript:golink(4))name +"\</b\>\</a\>";  
\_root.menu1.[[color=#0000ff]Link5[/color]\_txt.htmlText = “\<a href=’”+ \_root.menu1.[url=“javascript:golink(5)”][color=#0000ff]Link5[/color]+ “’\>\<b\>”+ \_root.menu1.[url=“javascript:golink(5)”][color=#0000ff]Link5[/color]](javascript:golink(5))name +"\</b\>\</a\>";  
\_root.menu1.[[color=#0000ff]Link6[/color]\_txt.htmlText = “\<a href=’”+ \_root.menu1.[url=“javascript:golink(6)”][color=#0000ff]Link6[/color]+ “’\>\<b\>”+ \_root.menu1.[url=“javascript:golink(6)”][color=#0000ff]Link6[/color]](javascript:golink(6))name +"\</b\>\</a\>";
