PDA

View Full Version : An array of URLs, need some to open in a new window


shaver80
10-19-2005, 07:42 PM
I have a dynamic menu connected to a bunch of URLS using a 2 dimensional array. Some of them I want to open in a new window but the usual "_blank" doesn't seem to work. Any suggestions. Here is a sample of the array for the subnav buttons.

// Links for Sub Nav
subLinks = new Array();
subLinks[0] = new Array("http://www.awebsite.html","http://www.awebsite2.html");
subLinks[1] =new Array("http://www."http://www.bwebsite.html","http://www.bwebsite2.html");
subLinks[2] = new Array("http://www.awebsite.html","http://www.awebsite.html","http://www.awebsite.html");


each one has about 4 or five URLS but I didn't type them all in.
Any help would be awesome.

Thanks

Cota
10-19-2005, 09:53 PM
Have you tried
getURL(subLinks[1], "_blank");

shaver80
10-20-2005, 03:17 PM
Not all of the subnav links I want to open in a new window. Only some of them. So that entire array would open in a new window.

sophistikat
10-20-2005, 03:43 PM
have you tried creating a function for them, one to open in a new window and one to open in the same window?

pseudo-code
// your functions
function openNewWindow(arraynum){
getURL(subLinks[arraynum], "_blank");
}

function openSameWindow(arraynum){
getURL(subLinks[arraynum]);
}

// your buttons
btn1.onReleases = function () {
openNewWindow(1);
}

btn2.onRelease = function () {
openSameWindow(2);
}

Cota
10-20-2005, 08:44 PM
Or create a second 2 element array containing _blank and _self. Just use that array to determine if it will open in a new window or the same window..