var title = new Array(); //先申明数组 全部加载到数组中
var img = new Array();
var url = new Array();
{pc:content action="position" posid="1" order="listorder DESC" thumb="1" num="5"}
{php $a=1;}
{loop $data $r}
title[{$a}] = "{$r['title']}"; //title[1]='heloo'
img[{$a}] ="{thumb($r['thumb'],295,225)}";
url[{$a}] ="{$r['url']}";
{php $a++;}
{/loop}
{/pc}
var files = "";
var links = "";
var texts = "";
for(i=1;i
if(files=="") files = img[i]; //如果files=空 就赋值files == img[1] 然后+| +img[2] 最后就会输出上边的格式
else files += "|"+img[i];
}
for(i=1;i
if(links=="") links = url[i];
else links += "|"+url[i];
}
for(i=1;i
if(texts=="") texts = title[i];
else texts += "|"+title[i];
}
var titles = texts; //赋值
var imgs= files;
var urls=links;