从html中读取table????? <input type=button onclick="a=window.open();a.document.write(tbleID.outerHTML);a.document.execCommand('SaveAs');a.close()"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 net_lover(孟子E章)<input type=button onclick="a=window.open();a.document.write(tbleID.outerHTML);a.document.execCommand('SaveAs');a.close()">此办法存在很严重的缺陷!!!!!更可靠办法是:建缓冲文件 save.html,内容是:<script language="JavaScript">var content = window.opener.document.body.innerHTML;// 或 var content = window.opener.document.getElementById("myTableID").innerHTML;document.write(content);document.execCommand("SaveAs", false, "myTable.html");window.close();</script>在 myTableID 表格所在页面“保存”按钮onclick调用window.open("save.html",'buffer','top=60,left=30,location=0,width=100,height=60'); 对不起,save.html应该是这样的<body bgcolor="#FFFFFF" text="#000000" onload="save()"><script language="JavaScript">function save(){ var content = window.opener.document.body.innerHTML; //var content = window.opener.document.getElementById("myTableID").innerHTML; document.close(); document.write(content); document.execCommand("SaveAs", false, "myTable.html"); window.close();}</script></body> 关于DIV嵌套onmouseout事件 js如何太动构建一个控件 firefox里有个功能,查看选中部分的源代码 js疑难杂症 简易的表单检测 js控制图片比例缩放问题 如何通过JS来控制文本框中输入的为数字而且为1-100 在ASP中有方向键控制光标 请问:如何实现这样的效果? for(i=0x8000; i>0x8; i>>=1) 是么意思 这个事件如何调用 求教:如何将IE的头部分去掉
<input type=button onclick="a=window.open();a.document.write(tbleID.outerHTML);a.document.execCommand('SaveAs');a.close()">
此办法存在很严重的缺陷!!!!!更可靠办法是:
建缓冲文件 save.html,内容是:
<script language="JavaScript">
var content = window.opener.document.body.innerHTML;
// 或 var content = window.opener.document.getElementById("myTableID").innerHTML;
document.write(content);
document.execCommand("SaveAs", false, "myTable.html");
window.close();
</script>在 myTableID 表格所在页面“保存”按钮onclick调用window.open("save.html",'buffer','top=60,left=30,location=0,width=100,height=60');
对不起,save.html应该是这样的
<body bgcolor="#FFFFFF" text="#000000" onload="save()">
<script language="JavaScript">
function save()
{
var content = window.opener.document.body.innerHTML;
//var content = window.opener.document.getElementById("myTableID").innerHTML;
document.close();
document.write(content);
document.execCommand("SaveAs", false, "myTable.html");
window.close();
}
</script>
</body>