win.setExecOnReturn()

function f(w) {
    // w takes the value of w1 or w2, according to which 
    // window called the function on return
}
w1.setExecOnReturn(f)
w2.setExecOnReturn(f)
This method is called when a web request returns to a window's displayFrame, i.e. after the default window interaction methods. It is similar to the serverFrame method "setExecOnReturn()".