Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XHTML target attribute

Status
Not open for further replies.

LEICJDN1

Technical User
Nov 27, 2002
201
GB
More XHTML queries I am afraid!

Again, all page validates fine, except links with a target=_blank" attribute, which I use to force the href to open in a new window.

Is there an XHTML equivalent that will validate, or should I use javascript onclick event instead?

Thanks.
 
it might be that you've not used a double quote

try -> target="_blank" as far as I know this is ok

MrBelfry
 
Sorry, my typo. have used "_blank" which strict XHTML rejects.

Could use a Javascript workaround but I guess those with Java off will miss out.

Anyone know of an XHTML solution?

Cheers.
 
I had a similar problem with the target attribute under XHTML and couldn't find a solution anywhere. As far as I can remember it's the target attribute itself that causes the problem, I don't think it exists or is supported in XHTML.
Regards
Ian

Infinity exists! - I just haven't worked out a way to get there yet.

| |
 
Hmmm. Looks as if target will never be valid in XHTML strict (although OK in transitional pages)

A solution with javascript that will open in a new window for those with js and in the same window for those without is here:

 
Thanks MrBelfry.

Can't decide whether to switch to dtd doctype, or use the Javascript workaround I listed, and fulfill strict validation criteria.

Each are useful solutions though, thanks.

JDN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top