javascript处理table表格的代码

javascript 处理table表格的代码,学习js的朋友可以参考下。

复制代码 代码如下:


var picarry = {};
var lnkarry = {};
var ttlarry = {};
function FixCode(str){
return str.replace("'","=");
}
var t=document.getElementById("pictable");
var rl=t.rows.length;
var baseu= document.URL.replace(/(http.*\/)(.*)/, "$1");
if(baseu.indexOf("/servlet/")>=0)
baseu = baseu.replace("/servlet/","https://www.jb51.net/");

var txt="";
for(var i=0;i<rl;i++){
try{
picarry[i]=t.rows[i].cells[0].childNodes[0].src;
lnkarry[i]=t.rows[i].cells[2].innerHTML;
ttlarry[i]=FixCode(t.rows[i].cells[1].innerHTML);
document.getElementById("li_jimg"+i).innerHTML = '<a href="'https://www.jb51.net/+lnkarry[id]+'" target="_blank"><img src="'https://www.jb51.net/+picarry[id]+'" alt=""><\/a>';
alert(picarry[i]);
}catch(e){

}
}
document.write("<div><a href='"https://www.jb51.net/+lnkarry[0]+"' title='' target='_blank'><img1',transition='23'); visibility:visible;' alt='' src='"https://www.jb51.net/+picarry[0]+"'><\/a><ul><li><a href='"https://www.jb51.net/+lnkarry[0]+"' target='_blank'>"+ttlarry[0]+"<\/a><\/li><li><a href='"https://www.jb51.net/+lnkarry[1]+"' target='_blank'>"+ttlarry[1]+"<\/a><\/li><li><a href='"https://www.jb51.net/+lnkarry[2]+"' target='_blank'>"+ttlarry[2]+"<\/a><\/li><li><a href='"https://www.jb51.net/+lnkarry[3]+"' target='_blank'>"+ttlarry[3]+"<\/a><\/li><li><a href='"https://www.jb51.net/+lnkarry[4]+"' target='_blank'>"+ttlarry[4]+"<\/a><\/li><li><a href='"https://www.jb51.net/+lnkarry[5]+"' target='_blank'>"+ttlarry[5]+"<\/a><\/li><li><a href='"https://www.jb51.net/+lnkarry[6]+"' target='_blank'>"+ttlarry[6]+"<\/a><\/li><\/ul><\/div>");

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdfssf.html