Anyway that I can pass a table from one page to another pop-up page in jquery
Does anyone know whether i can pass a table f开发者_如何转开发rom a page to another pop-up page when the button been clicked?
Example: In page A, I have the following code :
<table>
<tr>
<td>Name</td>
<td>Age</td>
</tr>
<tr>
<td>Alan</td>
<td>12</td>
</tr>
<tr>
<td>Amy</td>
<td>13</td>
</tr>
</table>
when I clicked on the following javascript, new page will pop-up and it will passing the same table and information over:
window.open("pgTest.aspx");
Do anyone know whether it's possible happen in jquery, javasctip or ajax?
You can call a function in the parent window using opener.functionName and in that you can access the table in the parent window.
For more details read window.opener
In your parent (opener) window
<table id="table1">
....
</table>
function getTable() {
var tableObj = document.getElementById("table1");
return tableObj;
}
In your child window
opener.getTable();
When you open a new window, you can write whatever you want as its content, so you can do:
myNewWindow.document.write('<html><title></title>' + someElement.innerHTML + '</html>');
myNewWindow.document.close();
精彩评论