views:

12

answers:

1

Hello all, In my system i have a main page, what when clicking on any element on that page a new page is being open, in some cases (button click on child page) from the child page will be open a new page, and so on...when i deside to close any child i need to close all levels to the top and refresh the top level page becouse on the child level i'm doing Database manipulations and i need to see them when i am returning to the main page.

Every thing is working great, the only problem is with the refresh of the first page!!!!

and i've tried doing onunload... in the last child...and i'v tried JQuery focus for the page itself....

AnY one have any idea please???

Some code:1)this is in the top parent page:

$(document).live(
'focus',
function()
{
    window.location.reload(true);
}

);

2)this is in the last child (the one that the top parent page calls):

<body class="RTL" onunload = "opener.close()">

And i'v tried many variations of that....

If any one have any idea it will help alot, becouse as for now i need to do Setinterval() and refresh the main page all the time and this is really not nice....

10x

A: 

Consider using iframes to show the child pages. That way, the child can use window.parent.reload() to reload the page.

If that is not possible: Did you check that opener actually contains the correct window? It might be the second-last child instead.

Aaron Digulla
10x, but i realy don't want to use iframes....If there is any way to work around this i will use it first...but 10x
Erez
ok, update, when i added: onunload = "alert(opener)" in the body tag of the first child to check the opener nothing happend....no alert and nothing.....Do you have any ideas?
Erez
Check the JavaScript console for errors.
Aaron Digulla
i've managed doing it in the end by doing it from the parent page, saving the wondow.open() to a var and then asking about it....that worked great for me...but 10x :-)
Erez