Javascript – storing value in an array and passing that array to a js function

arrayscfunctionjavascript

This is a code from my c# web application

here [ Response.Write(match.Groups[1]); ] i will get a display of string array in my screen

i want to store this values in an array and have to pass that array to a javascript function

and then have to take each values from that array.

below is my js function

function openNewWindow() {
//alert("hello");

var theurl="http://www.gmail.com";
popupWin = window.open(theurl,
'_blank',
'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0')

}

Actually that array will store some hyperlinks, eg: http://www.gmail.com, http://www.google.co.in etc.

now i'm giving that hyperlinks manualy in the js variable [ theurl].

i want to pass my array values to this variable…

can any one help me to do this.

if anyone have a code please share it with me.

Thanks

Best Answer

Just concatenate all those urls with a special character (delimiter) and send that string to the JavaScript as a parameter.

In the JavaScript you can then split the string into urls and use them.

Thanks