hi Friends,
I have a js function
I want to assign a variable to a variable
my variable is in a forloop
I have two variables
ie;
var spcd_1= "http://www.colbridge.com";
var spcd_2 = "http://www.google.com";
below is my js function
function openNewWindow(spcd) {
//alert("hello");
var tt = spcd;
alert(tt);
var i=0;
var spcd_1= "http://www.colbridge.com";
var spcd_2 = "http://www.google.com";
for(i=1;i<3;i++)
{
var theurl="'spcd_'+i";
popupWin = window.open(theurl,
'_blank',
'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, width=640, height=480, left=0, top=0')
}
}
my problem is here
var theurl=spcd_+i;
I want to change theurl
value to spcd_1
and spcd_2
how to assign this correctly in the for loop
var theurl=spcd_+i;
can any one show me the correct method.
Thanks