[Pure HTML] Wat is hier nou niet goed aan?

Pagina: 1
Acties:

  • Guillome
  • Registratie: Januari 2001
  • Niet online
Hoi, sorry voor deze simpele domme vraag, maarre.....
What the **ck is hier nou niet goed aan? :?:?
Ik zie het echt niet meer.
JavaScript:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<html>
  <head>
    <script>
      function testf()
      {
        alert(document.getElementById("test").location);
      }
    </script>
  </head>
  <body>
    <div onclick="testf();">Test</div>
    <iframe id="test" src="test2.php"></iframe>
  </body>
</html>


Bij voorbaat dank, en alvast mijn excusses :X :/

edit.
Oh ja, als je 'document.getElementById("test")' vervangt door gewoon 'test' doet ie het wel........

[ Voor 43% gewijzigd door Guillome op 01-04-2003 21:43 ]

If then else matters! - I5 12600KF, Asus Tuf GT501, Gigabyte Gaming OC 16G 5080 RTX, Asus Tuf Gaming H670 Pro, 48GB, Corsair RM850X PSU, SN850 1TB, Arctic Liquid Freezer 280, ASUS RT-AX1800U router


  • Thijsmans
  • Registratie: Juli 2001
  • Laatst online: 21:20

Thijsmans

⭐⭐⭐⭐⭐ (5/5)

code:
1
document.getElementById("test").document.location

8)7

[ Voor 14% gewijzigd door Thijsmans op 01-04-2003 21:41 ]

Privacy-adepten vinden op AVGtekst.nl de Nederlandse AVG-tekst voorzien van uitspraken en besluiten.


  • Guillome
  • Registratie: Januari 2001
  • Niet online
Prammenhanger schreef op 01 April 2003 @ 21:41:
code:
1
document.getElementById("test").document.location

8)7
Moeje voor de lol eens testen... Doet ie niet.
Dan pakt ie z`n eigen scherm zeg maar ipv de iframe.

If then else matters! - I5 12600KF, Asus Tuf GT501, Gigabyte Gaming OC 16G 5080 RTX, Asus Tuf Gaming H670 Pro, 48GB, Corsair RM850X PSU, SN850 1TB, Arctic Liquid Freezer 280, ASUS RT-AX1800U router


  • Rickets
  • Registratie: Augustus 2001
  • Niet online

Rickets

Finger and a shift

JavaScript:
1
alert( document.getElementById( "test" ).src );

Doet dit wat je wilt? :)

If some cunt can fuck something up, that cunt will pick the worst possible time to fucking fuck it up, because that cunt’s a cunt.


  • Thijsmans
  • Registratie: Juli 2001
  • Laatst online: 21:20

Thijsmans

⭐⭐⭐⭐⭐ (5/5)

Als je dan van locatie verandert, blijft de src hetzelfde :)

Privacy-adepten vinden op AVGtekst.nl de Nederlandse AVG-tekst voorzien van uitspraken en besluiten.


  • Cyphax
  • Registratie: November 2000
  • Laatst online: 22:11

Cyphax

Moderator LNX/AI
Niet .location, maar .src opvragen :)
Tenminste, dat geeft niet "undefined" :)

Oh dat zegt Rickets ook :)
Prammenhanger schreef op 01 april 2003 @ 21:53:
Als je dan van locatie verandert, blijft de src hetzelfde :)
En als je van src verandert? :)

[ Voor 74% gewijzigd door Cyphax op 01-04-2003 21:54 ]

Saved by the buoyancy of citrus


  • Guillome
  • Registratie: Januari 2001
  • Niet online
Huh inderdaad, wat stom zeg.
Moet je maar eens kijken op http://xlerator.beefhole.nl/mdt .
Niet dat je kan inloggen, maar daar doet .location.href het wél.

Laat maar, dat was zonder document.getElemenbtblablabla :P
Hunkie, naja iig bedankt! :D

[ Voor 19% gewijzigd door Guillome op 01-04-2003 21:57 ]

If then else matters! - I5 12600KF, Asus Tuf GT501, Gigabyte Gaming OC 16G 5080 RTX, Asus Tuf Gaming H670 Pro, 48GB, Corsair RM850X PSU, SN850 1TB, Arctic Liquid Freezer 280, ASUS RT-AX1800U router


  • Rickets
  • Registratie: Augustus 2001
  • Niet online

Rickets

Finger and a shift

Prammenhanger schreef op 01 April 2003 @ 21:53:
Als je dan van locatie verandert, blijft de src hetzelfde :)
Ok, dit dan :)
JavaScript:
1
alert(window.frames['test'].document.location.href);

If some cunt can fuck something up, that cunt will pick the worst possible time to fucking fuck it up, because that cunt’s a cunt.


  • crisp
  • Registratie: Februari 2000
  • Laatst online: 01:05

crisp

Devver

Pixelated

Rickets schreef op 01 April 2003 @ 22:01:
[...]

Ok, dit dan :)
JavaScript:
1
alert(window.frames['test'].document.location.href);
Zolang de pagina in het frame binnen hetzelfde domein ligt werkt dat; anders krijg je een vette security error :)
Verder verdient het de voorkeur om of window.frames['test'].location.href of window.frames['test'].document.URL te gebruiken :)

Intentionally left blank

Pagina: 1