常用JS

防止页面被包含,onload执行:

if ( top != self ) { top.location.replace(unescape(top.location.pathname)); }

//删除表格所有行

function removeAllRow(table){
var len = table.rows.length;
for(var i=len-1; i>0; i--){
table.deleteRow(i);
}
}

你可能感兴趣的:(js)