Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2004
    Location
    CA
    Posts
    70
    Thanks
    3
    Thanked 0 Times in 0 Posts

    clickin on a link and openin it on new page

    does anybdoy no the script so that when u click on a link, the link opens up in a different page?

  • #2
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *posted by accident, sorry*
    Last edited by me'; 01-17-2004 at 10:41 AM.
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #3
    me'
    me' is offline
    Senior Coder
    Join Date
    Nov 2002
    Location
    Warwickshire, England
    Posts
    1,229
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes, but why would you want to do it? Reasons against:
    • The code isn't xhtml 1.1 compliant
    • It annoys people very much
    • A lot of browsers will block it if you try, anyway.
    Here's the code, anyway (theoretically):
    Code:
    <a href="page.html" target="_new">Link Text</a>
    Alternatively:
    Code:
    <a href="#" 
      onclick="
      window.open(
        'page.html',
        'pageTitle',
        'width=360, height=400, toolbar=no, resizable=yes, scrollbars=yes, top=10, left=10')">
      Link Text
    </a>
    David House - Perfect is achieved, not when there is nothing left to add, but when there is nothing left to take away. (Antoine de St. Exupery).
    W3Schools | XHTML Validator | CSS Validator | Colours | Typography | HTML&CSS FAQ | Go get Mozilla Now | I blog!

  • #4
    Regular Coder
    Join Date
    Dec 2003
    Location
    USA
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To build on what me' posted...
    Code:
    <a href="index.html" onclick=" window.open(this.href, 'pageTitle', 'width=360, height=400, toolbar=no, resizable=yes, 
    scrollbars=yes, top=10, left=10'); return false;"> Link Text </a>
    To make sure users without JS can still access the page.
    Last edited by Paul Jr; 01-17-2004 at 07:17 PM.

  • #5
    New Coder
    Join Date
    Jan 2004
    Location
    CA
    Posts
    70
    Thanks
    3
    Thanked 0 Times in 0 Posts

    thankks

    thanks so much. totally solved my problem.


  •  

    Posting Permissions

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