FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Invalid XHTML - Please help.

 


richard270384
Hi,

I'm working on a new design for my website. Last time was a bit of a rush job and this time I want to do it properly.

So anyway, I checked that my code was valid using the validator at w3c.org and recieved 2 errors (Not too bad if you ask me.)

The first error is fine, but the second one relates to the "target='_blank'" property on a link. Apparently, in XHTML strict you cannot use the target property.

Does anybody know how I can force a new window on the link if I can't use the target property? Obviously I could use javascript but it seems a little bit silly for something that should be so simple.

Cheers,
Richard
sonam
You can use for valid CSS target="_blank" but not target='_blank'. How you can see difference is only in double quotas.

EDIT:
I didn't see in your post XHTML strict and maybe this sugestion will not work. It is work good in transitional XHTML.

Sonam
richard270384
Sorry,

I am using XHTML strict.

And I do have double quotation marks.
mathiaus
W3C wrote:
Why was the target attribute removed from XHTML 1.1?

It wasn't. XHTML 1.0 comes in three versions: strict, transitional, and frameset. All three of these were deliberately kept as close as possible to HTML 4.01 as XML would allow. XHTML 1.1 is an updated version of XHTML 1.0 strict, and no version of HTML strict has ever included the target attribute. The other two versions, transitional and frameset, were not updated, because there was nothing to update. If you want to use the target attribute, use XHTML 1.0 transitional.


If you really want to use strict...
http://brucelawson.co.uk/index.php/2005/opening-links-in-new-windows-in-xhtml-strict/
richard270384
Thanks mathiaus. Certainly an interesting read.

Luckily, it's not that much of an important issue. It was just my preference to have external sites load in a new window - if anything so that people clearly know that it's not a part of my site.

I think for the purposes of keeping compliant, i'll just let remove the target attribute and let the sites open in the current browser window.

Cheers.
mathiaus
richard270384 wrote:
It was just my preference to have external sites load in a new window - if anything so that people clearly know that it's not a part of my site.


You could link all external links to a page of your own site which redirects those external sites, AFTER having displayed a notice about them not being related to you.

For example, this site links to my own. Instead of adding my url to the anchor tag directly, they link to http://www.thephoenixrises.org/go.php?redir=http%3A%2F%2Fsiriusblacks.co.uk%2F which shows the text
Quote:
You are now leaving Phoenix Rising. Please click here if you are not automatically redirected after ten seconds or if you do not wish to wait.

Neither Narrate Conferences, Inc. nor Phoenix Rising endorses or is responsible in any way for any content on third-party sites reached via links we have provided.

and links & redirects then to my site.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.