<script>
function test(){
DWREngine.setAsync(false);
SearchCheck.check(
function returnFun(data){
.getElementById("filebody").innerHTML=data;
}
);
}
$(document).ready(function(){
setInterval(function(){
DWREngine.setAsync(false);
SearchCheck.check(
function returnFun(data){
var list="";
for(var i=0;i<data.length;i++){
list+="<tr><td align='center' valign='middle'>"+data[i]+
"</td><td align='center' valign='middle'><a href='javascript:readfile('"+data[i]+"');'><span style='color:#0d94e7;'>查看</span></a></td>"+
"<td align='center' valign='middle'><a>下载</a></td></tr>";
}
$("#filebody").html(list);
}
);
},3000);
});
function readfile(name){
alert(name);
document.getElementById('name').value=name;
document.forms[0].action='readfile.action';
alert(document.forms[0].action);
document.forms[0].submit();
}
</script>
怎样将data[i]的值传入readfile(name);提交给action action需要这个name的值。。。这样写报错啊
------解决方案--------------------
list赋值换成下面的试试。
list += '<tr><td align="center" valign="middle">' + data[i] +
'</td><td align="center" valign="middle"><a href="javascript:readfile(\'' + data[i] + '\');"><span style="color:#0d94e7;">查看</span></a></td>' +
'<td align="center" valign="middle"><a>下载</a></td></tr>';