Results 1 to 4 of 4

Thread: New window

  1. #1
    Join Date
    Jan 2008
    Posts
    40
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default New window

    Most of the time I like to maintain the same window with links. But there are occasions when I'd like a new window appear, leaving the current window in place, one layer behind. Is there syntax available to modify the following to force the creation of a new window when clicked?

    HTML Code:
     We invite your <a href="../contactUs.html">comments</a>.
    Appreciated.

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Code:
    We invite your <a target="_blank" href="../contactUs.html">comments</a>.
    or

    Code:
    We invite your <a onclick="return window.open(this.href);" href="../contactUs.html">comments</a>.
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. The Following User Says Thank You to thetestingsite For This Useful Post:

    wanapitei (02-21-2008)

  4. #3
    Join Date
    Jan 2008
    Posts
    40
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by thetestingsite View Post
    Code:
    We invite your <a target="_blank" href="../contactUs.html">comments</a>.
    Works as desired.

    Quote Originally Posted by thetestingsite View Post
    Code:
    We invite your <a onclick="return window.open(this.href);" href="../contactUs.html">comments</a>.
    This one has the side effect of not only opening a new window with the desired page, but also switching the original window to this page as well, not desired in this case.

    Kind regards,

  5. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    For that second one, I typed it in wrong. It should be like so:

    Code:
    We invite your <a onclick="window.open(this.href); return false" href="../contactUs.html">comments</a>.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

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
  •