#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Missouri
    Posts
    31
    Rep Power
    0

    Question Opening a new window using HTML (not JavaScript)


    Okay, I have a feeling I already know the answer to this, but I will ask just in case I am working on out-dated info...

    To open an html link in a new window, say foo.html, one would write the code
    <a href="foo.html" target="_blank">. Is there a way to control the properties of this new window (such as height, width, etc)?

    I know how to do this with JavaScript window.open(), but I need to use html links for search engine reasons. And I have a feeling the answer will be no, but I felt I should ask just in case anyone has any ideas, or there have been advances that I am not aware of.
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,817
    Rep Power
    1099
    The answer is no, but you can do the following, which will continue to allow the search spiders to follow the particular URL.
    Code:
    <a href="foo.html" onclick="window.open(this.href,'newWindow');">
    The other nice advantage to this is that those w/o JS enabled will still be able to follow the link as well.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Location
    Missouri
    Posts
    31
    Rep Power
    0
    Thanks for the tip, but the is still the problem of the parent changing as well. Any ideas to something that could be added in the onClick handler to cause the parent to stay put?
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2003
    Posts
    804
    Rep Power
    101
    Code:
    <a href="foo.html" onclick="window.open(this.href,'newWindow'); return false;">
    Good ole' return false...

IMN logo majestic logo threadwatch logo seochat tools logo