SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Please help with window.Open script

    I'm definately NOT a programmer, but I'm trying to add some links to a page that open a new window without all that "stuff" on the top and sides. And I want it to be a fixed size.

    I've been able to do this in the past with GoLive but it puts in a LOT of code. I can't put any code between the <head> tags, just in the body (I am customizing part of my shopping cart pages).

    Is there any way to get this to work with a small script that only resides in the body? Any help would be greatly appreciated...

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you do open('blah.html','','width=300,height=200') it should work.

  3. #3
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd give it a name to be "safe" -- I havn't tried it without it.

    Code:
    <body>
    Blah blah blah...
    <a href="#" onClick="window.open('page.html', 'mywindow', width=200, height=300); return false;">
    </body>

  4. #4
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Sorry, that didn't work TWTCommish. I copied and pasted exactly as seen. When I look at it in a browser nothing appears. Any other ideas?

  5. #5
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I forgot to add text for the link:

    Code:
    <body>
    Blah blah blah...
    <a href="#" onClick="window.open('http://www.yahoo.com', 'mywindow', width=200, height=300); return false;">Click Me</a>
    </body>

  6. #6
    SitePoint Wizard silver trophy
    beley's Avatar
    Join Date
    May 2001
    Location
    LaGrange, Georgia
    Posts
    6,117
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    with the width and height attributes, you have to add ' and ' for it to work. Also, only the attribute in front works. If the width if first, it will work... and if the height is first it will work - and neither of them work in NS. I have played around with them but cannot figure out how to get them both to work in IE and NS.

  7. #7
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Works fine for me, you should post the html or a url to it.

  8. #8
    ********* Addict DLG_1's Avatar
    Join Date
    Jun 2000
    Location
    Texas, USA
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    don't put a space in between the width and height attributes, furthermore, and for future reference you will never want to put a space anywhere in the "name of the window".


    Sam


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •