windows - open, close
3 отговора
178 прегледа
windows - open, close
dudes imam sledniq problem - onload ot daden window otwarqm drug. samo che go otwarqm s JS. iskam ot wtoriq da wyrna edin link obratno w pyrwiq samo che s _parent ne stawa shtoto toj ne go priema za parent. kak da wyrna daden link w openera?
window.opener
window.opener.* v popup'a e ekvivalentno na window.* ot dolniq prozorec. Taka ot popup-a mojesh da komandvash parent window'a
primer:
o window.opener.document.write('text'); shte pishesh v dolniq window.
o ako imash variable ot dolniq window var foo = 5; mojesh da promenish stoinosta i to popup'a sys window.opener.foo = 6;
Dano tova ti svurshi rabota
primer:
o window.opener.document.write('text'); shte pishesh v dolniq window.
o ako imash variable ot dolniq window var foo = 5; mojesh da promenish stoinosta i to popup'a sys window.opener.foo = 6;
Dano tova ti svurshi rabota
Re: window.opener
typoto e che window.opener.close(); (ili kakto tam beshe sintaksisa) zatwarq popupa naprimer... men na praktika me interesuwa kakyw target bi otworil neshto w openera ;-/
| pro_01
| tldstudios.com
| pro_01
| tldstudios.com
Re: windows - open, close
zdrasti ....
Ami za da mojesh da "target"-wash daden prozorec pyrwo triabwa da mu znaesh imeto. Eto kakwo imam w predwid.
naprawi si 2 file-s w edna direktoria test1.htm i test2.htm sys slednoto sydyrjanie:
test1.htm
------------------------------
<script>
window.name = "vale"
open("test2.htm")
</script>
------------------------------
test2.htm:
-------------------------------
<a href="[линк]" target=vale>go to yahoo</a>
-------------------------------
Kato otworish test1.htm, shte se otwori popup s test2.htm w nego. Kato clicknesh na linka wyw wtoria prozorec (test2.htm) shte se zaredi yahoo.com w pyrwia prozorec (t.e. tam deto e bil test1.htm).
Cheers

Ami za da mojesh da "target"-wash daden prozorec pyrwo triabwa da mu znaesh imeto. Eto kakwo imam w predwid.
naprawi si 2 file-s w edna direktoria test1.htm i test2.htm sys slednoto sydyrjanie:
test1.htm
------------------------------
<script>
window.name = "vale"
open("test2.htm")
</script>
------------------------------
test2.htm:
-------------------------------
<a href="[линк]" target=vale>go to yahoo</a>
-------------------------------
Kato otworish test1.htm, shte se otwori popup s test2.htm w nego. Kato clicknesh na linka wyw wtoria prozorec (test2.htm) shte se zaredi yahoo.com w pyrwia prozorec (t.e. tam deto e bil test1.htm).
Cheers