Opening a new window on load using HTML ?

Discussion in 'HTML & Website Design' started by heshan86, Dec 15, 2010.

  1. #1
    Im trying to open a new window "onload" using HTML, I just found this code and tried it

    <body onload=window.open('http://www.yahoo.com/');return true;>

    it does work but i want to resize the window like the width and the height of the new window

    Heres the link to the page that i made using the code

    http://designstattoono1.com/testpagepopup/

    cheers
     
    heshan86, Dec 15, 2010 IP
  2. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Last edited: Dec 15, 2010
    CSM, Dec 15, 2010 IP
  3. RaPeRbOy

    RaPeRbOy Active Member

    Messages:
    425
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    90
    #3
    It`s a pop-up windows actually. All browsers now have protection for that...
     
    RaPeRbOy, Dec 15, 2010 IP
  4. Raymond_M

    Raymond_M Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I think to resize it you will need to write: <body onload=window.open('url of the link', 'title of the link' 'width=200px,height=200px');return true;>

    That will open the window to 200px wide and 200px high. I don't think it will have any scroll bars, or browser navigation though. <body> Is an HTML tag, and the onload and everything else inside the tag is Javascript code. I'm just now learning it, and if what you have written is working as a pop-up on load, then what I added should work also and specify the height and width.

    I don't think it is entirely correct though.
     
    Raymond_M, Dec 15, 2010 IP