I have a js function
I want to assign a variable to a variable
my variable is in forloop
I have two variables
t
var spcd_1= "http://www.colbridge.com";
var spcd_2 = "http://www.google.com";
below is my js function
function openNewWindow(spcd) {
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 the value theurlto spcd_1andspcd_2
how to properly assign this in a for loop
var theurl=spcd_+i;
can anyone show me the correct method.
thank
source
share