# \[MX\]getURL Javascript - Array Question

**URL:** <https://forum.kirupa.com/t/mx-geturl-javascript-array-question/60508>\
**Category:** flash\
**Created:** [August 10, 2004, 1:15pm UTC](https://forum.kirupa.com/t/mx-geturl-javascript-array-question/60508 "2004-08-10T13:15:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![foochuck](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@foochuck](https://forum.kirupa.com/u/foochuck)\
**Post date:** [August 10, 2004, 1:15pm UTC](https://forum.kirupa.com/t/mx-geturl-javascript-array-question/60508/1 "2004-08-10T13:15:08Z")

</div>

Hello,

I’m trying to get the code below to work, but no such luck:

```auto

var newsAry = new Array("news/040720.html");

for(i=1; i<=newsAry.length; i++) {
	this["btn" + i].index = i;
	this["btn" + i].onRelease = function() {
		 getURL("javascript:openNewWindow(" + newsAry[this.index - 1] + ",'newswin','height=400,width=450,toolbar=no,scrollbars=yes')");
	}
}

```

I’m trying to get the ‘newsAry’ Array to work in the javascript getURL action. When I use a regular html page in there the page works just fine. Any ideas as to what I’m doing wrong?

Foo :rd:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 10, 2004, 1:17pm UTC](https://forum.kirupa.com/t/mx-geturl-javascript-array-question/60508/2 "2004-08-10T13:17:57Z")

</div>

Sorry I just figured this out. Heres the answer if anyone cares:

```auto

var newsAry = new Array("news/040720.html");

for(i=1; i<=newsAry.length; i++) {
	this["btn" + i].index = i;
	this["btn" + i].onRelease = function() {
		 getURL("javascript:openNewWindow('" + newsAry[this.index - 1] + "','newswin','height=400,width=450,toolbar=no,scrollbars=yes')");

	}
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 10, 2004, 5:51pm UTC](https://forum.kirupa.com/t/mx-geturl-javascript-array-question/60508/3 "2004-08-10T17:51:15Z")

</div>

> toolbar=no,scrol lbars=yes  
> works??  
> waddya know…javascript is starting to understand more human speak!! lol i thought it had to be a boolean and dont those 2 spaces in the middle of the word _scrollbars_ interrupt? :S

Prophet.
