Yesterday I encountered a problem, that is, using window. add a hyperconnection to the open window. When you click this connection, you need to jump the content of the parent window to another page. This problem is finally solved later. Now I want to share it with you.
1. To facilitate the use of the entire project, I specially wrote this method into a JS file.
// JScript File
Function pageclass (o ){
For (X in O) This [x] = O [x];
This. Open = function (){
VaR pagebody =$ $ ("pagebody ");
VaR pagetitle =$ $ ("pagetitle ");
This. prevpage = pagebody. page;
// If (pagebody. Page & this. Loc = pagebody. Page. LOC ){
// Return;
//}
If (this. inherit ){
This. Loc = (pagebody & pagebody. Page? (Pagebody. Page. Loc + "^"): "") + this. LOC;
Delete this. inherit;
}
Pagetitle. innertext = This. Loc. Replace (// ^/GI, "-> ");
Window. Open ("about: bland", "pagebody", "", true );
Window. Open (this. url, "pagebody", "", true );
Pagebody. Page = this;
}
}
2. Add a client function in the parent window
For example:
Note: You need to first load the created JS file in the parent window. The parameter ID here is the ID of the input data.
Function openrredirect (ID ){
New pageclass ({URL: "test. aspx? Id = "+ id, Loc:" title "}). open ();
}
3. At last, you can add <A> hyperconnections In the window. You only need to call this method in the parent window.
<A href = "#" onclick = "javascript: opener. openrredirect. Call (opener, ID);/"> </a>