Toon posts:

[JS] onload= window.open

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik wil een pop-up maken die laadt wanneer de pagina geopend wordt. Normaal is dit geen probleem, ik kan alleen niks in de body tag zetten.

Ik heb verscheidene dingen geprobeerd. Wat ik tot nu toe heb is:
function popup() {
window.open( "http://www.hyperdictionary.com","popup", "toolbar=0,location=1,status=1,menubar=1,scrollbars=1,resizable=1,width=820,height=700")
}

In alle tutorials die ik kan vinden staat dat zo'n soort functie moet worden aangeroepen in de body. Weet iemand een andere oplossing?

  • BtM909
  • Registratie: Juni 2000
  • Niet online

BtM909

Watch out Guys...

Je kan niks in de body zetten?

Dan gebruik je toch gewoon:

JavaScript:
1
window.onload = popup;


;)

Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.


  • Tony diNovo
  • Registratie: Maart 2004
  • Laatst online: 05-06-2025
Je kan na je code tussen je SCRIPT-tags gewoon je functie aanroepen
Dus eronder gewoon popup(); zetten.
Of je laat gewoon de regels weg die je functie aanmaken. Dan wordt als het goed is direct je window.open uitgevoerd.

code:
1
window.open( "http://www.hyperdictionary.com","popup", "toolbar=0,location=1,status=1,menubar=1,scrollbars=1,resizable=1,width=820,height=700")

[ Voor 6% gewijzigd door Tony diNovo op 20-05-2005 12:16 ]

http://specs.tweak.to/9537


Verwijderd

Topicstarter
Ut werkt ut werkt ut werkt!

window.onload = pop-up;

*Doest the happy dance*

Tnx :D