Avatar billede stigc Nybegynder
15. august 2000 - 10:26 Der er 5 kommentarer og
1 løsning

snakke mellem to vinduer HASTER!!!!

http://www.eksperten.dk/spm/23049

Jeg skal snakke overfører vædier fra det ene vindue til det andet. Hvordan? se spm...
Avatar billede limemedia Nybegynder
15. august 2000 - 10:30 #1
Kan det her bruges ?
http://www.eksperten.dk/spm/19809
Avatar billede limemedia Nybegynder
15. august 2000 - 10:32 #2
Interrogation
With frames in a frameset its fairly straight forward to access the parent frame or the child frame, all you need to do is remember the object hierarchy. For example, the following frameset:

<FRAMESET COS=\"50%,50%>
<FRAME SRC=\"one.htm\" NAME=\"left\">
<FRAME SRC=\"two.htm\" NAME=\"right\">
</FRAMESET>

Produces the following structure:


            Parent Frame
                  |
            +----+----+
            |        |
          one.htm  two.htm


To access the parent frame from one.htm, use simply use: alert(parent.location.href), which will highlight the location of the parent frame, and similarily, to perform the reverse alert(window.one.location.href) will highlight the location of the left frame from the parent frame, and alert(parent.two.location.href) will highlight the location of the right frame from the left frame.

Once you\'ve established this simple object syntax, you can use it to read and write almost any property of any other window within the frameset.

However, when you\'ve opened a new window, the window does not form part of a frameset -- therefore a new means of accessing the new window from the opener (i.e., the window that opens the new window) is required and vice versa.

Well, accessing the new window is straight forward enough, you just use the window name as shown in the previous example. Modern browsers also include a means of accessing the opener window. Funny enough, by providing an opener property, e.g., window.opener, which will reference the window, if any, that opened the current window. For example alert(window.opener.location.href) will highlight the location of the current window\'s opener.

Unfortunately, the opener property was not made available in older browsers -- it was introduced in Nav3 -- but, we are able to create our own window properties/variables at any time:

<SCRIPT LANGUAGE=\"JavaScript\">
<!--
myWindow10 = window.open(\'blank.htm\',\'myExample10\',\'width=200,height=200\');
if (newWindow10.opener == null)
    newWindow10.opener = self;
//-->
</SCRIPT>

15. august 2000 - 10:45 #3
Hvis du vil overføre værdier fra et formfelt, er der et rimeligt eksempel her der kan modifiseres..

http://javascript.internet.com/forms/field-explanation.html
Avatar billede mpj Nybegynder
15. august 2000 - 16:16 #4
Virkede det ikke?
Avatar billede stigc Nybegynder
15. august 2000 - 22:16 #5
jo det virkede fint........
Avatar billede mpj Nybegynder
16. august 2000 - 16:37 #6
Øhh hvorfor stillede du så det her spm? og gav ljweb point?
Øhh...?
*Confused*
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester