Please see my code below:
var callback = function(popup_window) {
popup_window.close();
//some more codes here
};
var prepare = function(cb) {
popup_window = window.open("my_url");
this.cb(popup_window);
};
function refresh(){
prepare(callback);
};
How can I pass the popup_window variable to the callback function ?
this.cb(popup_window);. What do you really mean? Note: whythis.cb()? I wouldn't expect that to work, whilecb()should work.