我有两页
page1.html
<html>
<head>
<script src="sorttable.js"></script>
<script type="text/javascript">
function PrintDiv(id) {
var divToPrint = document.getElementById(id);
var popupWin = window.open("page2.html");
// what here?
popupWin.document.getElementById('div2').appendChild(divToPrint);
popupWin.document.getElementById(id + '_t').style.display = "block";
popupWin.document.getElementById(id + '_t').setAttribute("class","sortable");
}
</script>
</head>
<body >
<div id="divToPrint" >
<table class = "sortable" id="divToPrint_t" style="display:none;">
<tr>
<th>Edificio</th>
<th>Tipo</th>
</tr>
<tr>
<td>E1</td>
<td>T1</td>
</tr>
<tr>
<td>A1</td>
<td>Q1</td>
</tr>
</table>
</div>
<div>
<input type="button" value="print" onclick="PrintDiv('divToPrint');" />
</div>
</body>
</html>page2.html
<html>
<head>
<script src="sorttable.js"> </script>
</head>
<body>
<div id="div2">
</div>
</body>
</html>我需要它,当我按下按钮,打开新的标签,用page2.html,和DIV div2中的表格……具有显示块,并保持类的可排序以进行排序。
怎么才能做到呢?
发布于 2014-02-16 04:42:49
我非常确定您必须使用Ajax来完成您想要做的事情
https://stackoverflow.com/questions/21803350
复制相似问题