Results 1 to 4 of 4

Thread: help with a popup link

  1. #1
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with a popup link

    http://www.tstiger.org.uk/news.htm

    On this webpage in the 'ships log' section I use popup links to pages with more info,

    In the entries for 16th June and the 2nd/3rd June the link opens incorrectly in a full sized window in IE(v7) but opens correctly (520 px wide) in firefox(2.0.0.4)

    In all other instances of the links in the log they work ok in both browsers, they are also ok in previous years logs.

    when i use the links i just cut n paste them in from a comment in that same page

    As far as i can see the links are the same format but I just can't see why they work differently

    IE reports an error for line 142 and 182 character 1 as 'invalid argument' but i just can't see any difference.

    I would appreciate any help thanks
    PdS

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Technically, you cannot have spaces in the name/target field for window.open() method:

    Code:
    window.open('2007openday/popopenday.htm', 'Open Day 07', 'resizable=no, scrollbars=yes, toolbar=no, loca . . .
    Many browsers will let you get away with it, but IE 7 will not, you can do:

    Code:
    window.open('2007openday/popopenday.htm', 'Open_Day_07', 'resizable=no, scrollbars=yes, toolbar=no, loca . . .
    Also, since you are opening the link itself in the pop up, you can do:

    Code:
    window.open(this.href, 'Open_Day_07', 'resizable=no, scrollbars=yes, toolbar=no, loca . . .
    Finally, since true/false specifications not listed are configured as false and those listed are configured as true even when no value is given, you could use just:

    Code:
    window.open(this.href, 'Open_Day_07', 'scrollbars, width=540, height=500, top=50, left=5')
    for this type of pop up.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Wait, I spoke too soon! For what you are doing, since you already list the target in the anchor tag, you could even have:

    Code:
    <a href="2007openday/popopenday.htm" target="_blank" onclick="window.open(this.href, this.target, 'scrollbars, width=540, height=500, top=50, left=5');return false;">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Oct 2006
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the help I shall try that out,
    I didn't know about the spaces and I think that they are the first time i have used them.

    thanx again
    PdS

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
  •