It was late last night and I couldn't find a way. To the official website API to see for a long time, and searched the Internet for a long period always can not find the answer. Today I finally found a way.
Difficulty: Because both the Confirm and cancel buttons are called in the parent window of the JS generated button. You can only go back to the data and close the child window when the parent window is recalled. Not the Subwindow itself closes and the data is passed to the parent window. Many of the answers on the web are the way the subwindow closes itself and passes the data to the parent window.
"By sticking out my own code, I've probably implemented the process." Specific self-modification according to the circumstances "
My Code function is a child window to pass an array to the parent window, a specific complex data format (such as JSON, etc.) similar to
1. sub-window code
var URLs; function Geturls () { return URLs; }
The value of the variable is passed out in a method
2. The Code of the parent window
function Openwindow () { Top.layer.open ({ ID: "Uploadpic", title: "Image upload", content: "/actor/ Uploadpic ", area : [" 800px "," 580px "], shade:0.3, type:2, fix:false, btn: [' Confirm ', ' close '], Btnclass: [' btn btn-primary ', ' btn Btn-danger '], yes:function (index, Layero) { var tem = $ (Layero). Find ("Ifra Me ") [0].contentwindow.geturls (); Piccallback (TEM); Parent.layer.close (index); }, Cancel:function () { return true; } });
The method of the tone window takes the data and closes the child window
3.
The Piccallback method is the parent window's method, the parameter is the data which passes from the child window, the concrete method does not write,
That's probably the process.
Layer.js a child window closes and passes data to the parent window method