是否有办法改变这种状况:
$( #id ).testfunction({
source : [
{ source : pathimage.jpg , title : Title 1 , description : This is a description 1. },
{ source : pathimage.jpg , title : Title 2 , description : This is a description 2. },
{ source : pathimage.jpg , title : Title 3 , description : This is a description 3. },
{ source : pathimage.jpg , title : Title 4 , description : This is a description 4. },
{ source : pathimage.jpg , title : Title 5 , description : This is a description 5. }
]
});
简单易举的产出:
$( #id ).testfunction({
source :[
$SOURCE
]
});
我是个阵列,并试图将其重新编成一个阵列。 缩略语
$SOURCE = myArray[0], myArray[1], myArray[2], myArray[3], myArray[4];
But its the comma thingy that keeps prevent the variable from working. I can t get the comma into the variable. Using + "," +
doesnt work since it recognizes it as a string...
$SOURCE += myArray[s],;
是否有办法将这一变量转化为有活力的使用?