From: DL on 31 May 2010 20:48 Hi, I have a main page and a secondary page, what I'd like to do is like this: when the second page is opened and if the user take an action, that is, click on a link on the second page, then, when the second page is closed I want the main page to be refreshed (so, for the second page, body onunload="opener.reload()") but again, do so if only the user click on a link of the second page, is there something like if conditionX is true document.body.onunload=false? Let me if the above problem statement is clear. Thanks.
From: DL on 1 Jun 2010 00:32 On May 31, 8:48 pm, DL <tatata9...(a)gmail.com> wrote: > Hi, > > I have a main page and a secondary page, what I'd like to do is like > this: > when the second page is opened and if the user take an action, that > is, click on a link on the second page, then, when the second page is > closed I want the main page to be refreshed > (so, for the second page, body onunload="opener.reload()") > but again, do so if only the user click on a link of the second page, > is there something like if conditionX is true > document.body.onunload=false? > > Let me if the above problem statement is clear. > > Thanks. Posted it too fast, so, there are some grammar errors etc. Here's another way to describe it. Page A -> Page B (pB) Two possibilities for pB: a) Click on a link b) Do not click on anything and close pB Desired outcome for pB For the above a): Make the body onunload="opener.reload()" valid for pB For the above b): Make the body onunload="opener.reload()" invalid for pB How could we achieve it? Thanks in advance.
From: SAM on 1 Jun 2010 04:35 Le 6/1/10 6:32 AM, DL a �crit : > > Page A -> Page B (pB) > > Two possibilities for pB: > a) Click on a link > b) Do not click on anything and close pB > > Desired outcome for pB > For the above a): > Make the body onunload="opener.reload()" valid for pB > For the above b): > Make the body onunload="opener.reload()" invalid for pB from B, open mother (A) opener.reload(); open grand mother (mother of A) and probably if A wasn't closed opener.opener.reload() but ... any way, to play with popups is bad ... -- sm
From: DL on 1 Jun 2010 23:57 On Jun 1, 4:35 am, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid> wrote: > Le 6/1/10 6:32 AM, DL a écrit : > > > > >PageA ->PageB (pB) > > > Two possibilities for pB: > > a) Click on a link > > b) Do not click on anything and close pB > > > Desired outcome for pB > > For the above a): > > Make the body onunload="opener.reload()" valid for pB > > For the above b): > > Make the body onunload="opener.reload()" invalid for pB > > from B, > open mother (A) > opener.reload(); > open grand mother (mother of A) and probably if A wasn't closed > opener.opener.reload() > > but ... any way, to play with popups is bad ... > -- > sm Sorry, Sam, I don't get it. But there's a good reason for doing what I'm doing.
From: SAM on 2 Jun 2010 07:57 Le 6/2/10 5:57 AM, DL a �crit : > On Jun 1, 4:35 am, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid> > wrote: >> >> but ... any way, to play with popups is bad ... > > Sorry, Sam, I don't get it. But there's a good reason for doing what > I'm doing. Sorry, but my answer certainly didn't give the solution. Supposing links in B open called file in B. Then, - will B remember the "onunload" ? ? - will B remenber its opener ? Test and try something like that in files in B : var pB = false; function reloadMain() { if(!opener) alert('mother is lost !'); else if(pB) opener.reload(); } function yesNo() { pB = true; setTimeout(function(){pB=false;},100); } function init() { var a = document.links, n = a.length; while(n--) a[n].onclick = yesNo; } <body onload="init()" onunload="reloadMain()" -- sm
|
Next
|
Last
Pages: 1 2 3 Prev: FAQ Topic - What is a native object? (2010-06-01) Next: Qooxdoo--garbage? |