JS - window.close()
4 отговора
138 прегледа
JS - window.close()
Zdraveite vsichki
V knigata na O'Reilly pishe slednoto:
"In JavaScript 1.1, only windows that are opened by JavaScript can be closed by JavaScript."
Netscape Communicator 4.73 primerno, polzva JS 1.2 ili pochti ;-) Ne znam kak stoi vyprosa tam s tazi funkcia.
Ako zatvoria prozorec ot butoncheto x gore v diasno na browsera, izliza, che JS haber si niama, che prozoreca e bil zatvoren. I syotvetno, ne bih mogla da izpolzvam property-to window.closed, za da proveria dali prozoreca e bil zatvoren, zashtoto window.closed niama da e = 'true'. Prichinata e: prozorecyt e bil zatvoren ot usera, a ne ot JS s window.close().
Ima li nachin da se detect-ne koga edin prozorec e bil zatvoren ot usera?
Blagodaria.
What seems terribly important one day just doesn’t seem to matter the next.
V knigata na O'Reilly pishe slednoto:
"In JavaScript 1.1, only windows that are opened by JavaScript can be closed by JavaScript."
Netscape Communicator 4.73 primerno, polzva JS 1.2 ili pochti ;-) Ne znam kak stoi vyprosa tam s tazi funkcia.
Ako zatvoria prozorec ot butoncheto x gore v diasno na browsera, izliza, che JS haber si niama, che prozoreca e bil zatvoren. I syotvetno, ne bih mogla da izpolzvam property-to window.closed, za da proveria dali prozoreca e bil zatvoren, zashtoto window.closed niama da e = 'true'. Prichinata e: prozorecyt e bil zatvoren ot usera, a ne ot JS s window.close().
Ima li nachin da se detect-ne koga edin prozorec e bil zatvoren ot usera?
Blagodaria.
What seems terribly important one day just doesn’t seem to matter the next.
Re: JS - window.close()
ami kat si naprawish edin window primerno var a = window.open(blah blah)
sled towa ako usera wzeme che zatwori windowa, mogesh da go slogish w edin if...
naprimer if (a && (a.document || a.frames)) //te tuke sha e otworen
else
//ahhh gadniqt user....
bi trebwalo taka da stawa i za dwata/trite/ browsera....
ama ne garanciram :)))
on error try next variant
JAVA lets make things badly and slow!!
sled towa ako usera wzeme che zatwori windowa, mogesh da go slogish w edin if...
naprimer if (a && (a.document || a.frames)) //te tuke sha e otworen
else
//ahhh gadniqt user....
bi trebwalo taka da stawa i za dwata/trite/ browsera....
ama ne garanciram :)))
on error try next variant
JAVA lets make things badly and slow!!
ideia nedonosche
prosto ideia
polzvash OnClose ili kufto tam beshe eventa za da setnesh onaia boolean stoinost na false... taka i da go zatvori usera pak shte ia imash.... neznam kak se pravi i neznam dali raboti :)
I am not crazy. I just have been in a very bad mood for the last 23 years.
polzvash OnClose ili kufto tam beshe eventa za da setnesh onaia boolean stoinost na false... taka i da go zatvori usera pak shte ia imash.... neznam kak se pravi i neznam dali raboti :)
I am not crazy. I just have been in a very bad mood for the last 23 years.
Re: JS - window.close()
slagash edna globalna promenliva v koiato da ti setva window handler-a sled open
proverkata dali e zatvoren e if(!childWnd || childWnd.closed)
raboti pod Opera i IE (s nastroiki za IE i NS )
uspeh
proverkata dali e zatvoren e if(!childWnd || childWnd.closed)
raboti pod Opera i IE (s nastroiki za IE i NS )
uspeh
Re: JS - window.close()
Blagodaria na vsichki! Shte probvam i shte se pohvalia (nadiavam se).
What seems terribly important one day just doesn’t seem to matter the next.
What seems terribly important one day just doesn’t seem to matter the next.