从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> 说实在的真讨厌jquery javascript线程问题,求解释 急!Google Chrome浏览器怎么调用exe? 禁止输入除数字以外的其它字符 求一个下拉菜单的解决方法,在线等。 提交稍大容量表单数据,需要帮助~~~~~~~~ 如何用JS判断一个网页中的图片是否下载结束 关于iframe的捕捉键盘事件 调整下拉框内容顺序 怎么样在点击IE右上角的关闭来关闭窗口的时候弹出一个小的窗口呢?急。。。。!急急急 这个事件如何调用 求教:如何将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>