www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > HTML

    HTML Discussion and technical support for building, using and deploying HTML sites.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 12-30-2003, 08:54 PM
    jasondubya jasondubya is offline
    Registered User
     
    Join Date: Oct 2003
    Location: Vancouver, WA
    Posts: 30
    XHTML 1.1 --> target attribute

    I am in the process of developing a new site. The plan is to have the site comply with the XHTML 1.1 Recommendation. Upon validating the documents that I have, I receive the following error:

    Quote:
    Error: there is no attribute target for this element (in this HTML version)
    I need to use the target attribute, or something similar, to cause the browser to open the link in a new browser window. Is there an attribute for the a element in XHTML 1.1 that will do this?
    Reply With Quote
      #2  
    Old 12-30-2003, 09:10 PM
    pyro's Avatar
    pyro pyro is offline
    Registered User
     
    Join Date: Dec 2002
    Location: High on life
    Posts: 10,183
    Nope. You can, however, use JavaScript to open it in a new window:

    <a href="http://www.w3.org/" onclick="window.open(this.href); return false;">W3C</a>
    __________________

    Personal website http://www.ryanbrill.com/
    Business website: http://www.infinitywebdesign.com/
    TypeSpace http://www.typespace.org/

    I reject your reality and substitute it with my own!
    Reply With Quote
      #3  
    Old 12-30-2003, 11:50 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    Also:
    Code:
    <a href="http://www.google.com/" onclick="target='_blank';">Google</a>
    Reply With Quote
      #4  
    Old 01-02-2004, 03:28 AM
    Sux0rZh@jc0rz's Avatar
    Sux0rZh@jc0rz Sux0rZh@jc0rz is offline
    Xaxei
     
    Join Date: Aug 2003
    Location: In front of my computer
    Posts: 781
    can u open a window using php? if so, could one do action="open.php" then have open.php open the new window and ergo, it be valid plus work for all users instead of working for 87% like JS?
    __________________
    Theres this thing called imperfection. Its the one thing everyones got but nobody wants.

    I.. HATE.. EVERYTHING ABOUT YOU! Why do.. I Love you? I HATE Everything about you! Why do I.. love you??? Everytime we lie awake... after every hit we take.. every feeling that i get.. but i haven't missed you yet. only when I stop to think about it... I.. HATE.. EVERYTHING ABOUT YOU! Why do.. I Love you? I HATE Everything about you! Why do I.. love you?
    Reply With Quote
      #5  
    Old 01-02-2004, 06:29 AM
    AdamGundry's Avatar
    AdamGundry AdamGundry is offline
    Not quite a mathematician
     
    Join Date: Nov 2002
    Location: Dartmoor [Holiday]
    Posts: 2,406
    No, PHP runs on the server-side and hence cannot open new windows, which is an inherently client-side activity. AFAIK, the best method is pyro's, which will open a new window if JS is enabled and use the current one if it is not.

    Adam
    __________________
    "If you’re not using valid HTML, then you haven’t created a Web page. You may have created something else, but it isn’t a Web page." - Joe Clark

    Do something amazing (USA) | Make Poverty History
    Reply With Quote
      #6  
    Old 01-05-2004, 01:51 PM
    Robert Wellock's Avatar
    Robert Wellock Robert Wellock is offline
    XHTML Master
     
    Join Date: Nov 2002
    Location: XYZZY - UK
    Posts: 1,805
    Alternatively you use the eXtensibility aspect of XHTML 1.1 and reintroduce the target but it was removed for a good reason.
    __________________

    };-) http://www.xhtmlcoder.com/
    Reply With Quote
      #7  
    Old 01-05-2004, 04:18 PM
    Paul Jr's Avatar
    Paul Jr Paul Jr is offline
    will punch your face off
     
    Join Date: Aug 2003
    Location: In my house
    Posts: 4,331
    Quote:
    Originally posted by Robert Wellock
    it was removed for a good reason.
    Just curious, but what would that reason be?
    __________________
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death
    Reply With Quote
      #8  
    Old 01-05-2004, 04:21 PM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    Quote:
    Originally posted by Paul Jr
    Just curious, but what would that reason be?
    Two things come to mind:
    1. It causes accessibility problems.
    2. Users should be able to decide whether they want links to open in a new window or not.
    Reply With Quote
      #9  
    Old 01-05-2004, 04:42 PM
    Paul Jr's Avatar
    Paul Jr Paul Jr is offline
    will punch your face off
     
    Join Date: Aug 2003
    Location: In my house
    Posts: 4,331
    Quote:
    Originally posted by fredmv
    Two things come to mind:
    1. It causes accessibility problems.
    2. Users should be able to decide whether they want links to open in a new window or not.
    Thanks for the linkage, and I completely agree. I don't like it when people have new windows opening all over the place.
    __________________
    Thousand different paths
    So many sterile ends
    I chose the Devil's path

    Never shall the sun kiss my face
    And caress me with it's burning light
    For I dwell in the shadows
    And sleep side by side with death
    Reply With Quote
      #10  
    Old 02-15-2004, 05:19 PM
    tbeach44 tbeach44 is offline
    Registered User
     
    Join Date: Feb 2004
    Posts: 9
    There are some times when a new window is desirable and I recently ran across some tags from PayPal for insertion of their logo that included the target attribute. So if I wanted to include the logo I would have to alter their tags but I couldn't find an alternative in xhtml. However I believe that is only true if you validate as strict. According to what I read it will work in xhtml as transitiional. In my case the logo wasn't that important and I scrapped it.
    I am surprised that this is not an option to developers using xhtml and validating strict however. There are definately times when a new window is desirable.
    __________________
    Tom Beach
    http://www.northcrafts.com
    Reply With Quote
      #11  
    Old 02-16-2004, 03:54 AM
    fredmv's Avatar
    fredmv fredmv is offline
    Moderator
     
    Join Date: Jul 2003
    Location: Boston Area, Massachusetts
    Posts: 3,499
    Quote:
    Originally posted by tbeach44
    I am surprised that this is not an option to developers using xhtml and validating strict however.
    Technically, it is. Did you read this entire thread? You can either emulate it using JavaScript and thus still being degradable, or use the extensibility aspect of XHTML and add the attribute yourself as Robert has already implied.

    Last edited by fredmv; 04-02-2004 at 12:34 PM.
    Reply With Quote
      #12  
    Old 02-16-2004, 04:38 PM
    tbeach44 tbeach44 is offline
    Registered User
     
    Join Date: Feb 2004
    Posts: 9
    Quote:
    Originally posted by fredmv
    , or use the extensibility aspect of XHTML and add the attribute yourself as Robert has already implied.
    Could you explain that please.
    __________________
    Tom Beach
    http://www.northcrafts.com
    Reply With Quote
      #13  
    Old 02-17-2004, 10:00 AM
    Robert Wellock's Avatar
    Robert Wellock Robert Wellock is offline
    XHTML Master
     
    Join Date: Nov 2002
    Location: XYZZY - UK
    Posts: 1,805
    I can explain it visit http://www.xhtmlcoder.com/beck.htm click on one of the movie links watch the movie view the page source.

    Notice I have used <embed /> find the that page address; shove the page containing the embedded QuickTime Movie through the W3C Validator and notice it validates even though <embed /> is not an official W3C element.

    In other words I have added a new element called <embed /> to XHTML 1.0 Strict; eXtending by using the Black Arts of EBNF and DTD hence applying eXtensibility.
    __________________

    };-) http://www.xhtmlcoder.com/
    Reply With Quote
      #14  
    Old 02-19-2004, 01:23 PM
    gizmo gizmo is offline
    Registered User
     
    Join Date: May 2003
    Location: Andover, UK
    Posts: 413
    validation error, target with anchor tag

    I am in the process of converting one of my sites to xhtml1.0 strict. For the <a> tag, w3schools states that there is no difference between html and xhtml, yet several pages which use the line:
    <a href="index.html" target="_top">Home Page</a> no longer validate with the error "You have used an attribute with an element that is defined not to have that attribute" yet the example given is
    <a href="http://www.w3schools.com" target="_blank">W3Schools</a>
    Does this mean that for xhtml1.0 that w3schools is incorrect ?
    Reply With Quote
      #15  
    Old 02-19-2004, 06:23 PM
    MrPunkin MrPunkin is offline
    Registered User
     
    Join Date: May 2003
    Location: Vancouver, WA
    Posts: 47
    Jason,

    I went though the same problem when creating my site

    I decided to ditch it in the long run though. IM me sometime... im interested in seeing what your working on.


    Bryan
    __________________
    Bryan
    Mrpunkin.coM
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 10:20 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.