I would like to know how to access a function in a window from a created window. Here is a sample.
Original Window:
function OpenJobPage(var id)
{
var newWin = window.open('su bwin.aspx?id=' + varid, 'popNewWindow' + jobid, 'toolbar=0, ' + 'height=500, width=850, resizable=1, scrollbars=1');
if(newWin.opene r == null)
newWin.opener = window;
newWin.focus();
return false;
}
function RefreshContents ()
{
// ... function
}
// Function in created window
function RefreshParent()
{
try
{
if(window.opene r != null)
{
alert("Attempti ng Refresh");
parent.window.o pener.RefreshLi st();
}
}
catch(ex)
{
alert("Function Missing:\n\n" + ex);
}
}
I get the refresh alert, it just doesn't run the script from the first window.
Thanks,
Leo
Original Window:
function OpenJobPage(var id)
{
var newWin = window.open('su bwin.aspx?id=' + varid, 'popNewWindow' + jobid, 'toolbar=0, ' + 'height=500, width=850, resizable=1, scrollbars=1');
if(newWin.opene r == null)
newWin.opener = window;
newWin.focus();
return false;
}
function RefreshContents ()
{
// ... function
}
// Function in created window
function RefreshParent()
{
try
{
if(window.opene r != null)
{
alert("Attempti ng Refresh");
parent.window.o pener.RefreshLi st();
}
}
catch(ex)
{
alert("Function Missing:\n\n" + ex);
}
}
I get the refresh alert, it just doesn't run the script from the first window.
Thanks,
Leo
Comment