Help - Search - Members - Calendar
Full Version: Attribute: target;
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
James
When I validate the HTML in my site using the WDG HTML Validator I get the following error on those pages with Level of HTML: HTML 4.01 Strict.

Error: there is no attribute TARGET for this element (in this HTML version)

I am used to using target="_blank" when I want a linked new page to open up in a new browser screen, but apparently one cannot do that in HTML 4.01 Strict

QUESTIONS:

1. Why is the attribute, "target", deleted from version 4.01 strict?
2. With 4.01 Strict, how do I get a link to open in a new page?
3. What is the best version to use if one is currently building a site? - Strict? - or Transitional?

I look forward to your advice.

Kind regards, James
lavazza
QUOTE(James @ Jul 2 2007, 11:52 PM) *
1. Why is the attribute, "target", deleted from version 4.01 strict?
2. With 4.01 Strict, how do I get a link to open in a new page?
3. What is the best version to use if one is currently building a site? - Strict? - or Transitional?

1. It is to be 'deprecated' for a few reasons. The #1 in my book: it is really, really annoying! If you follow such a link and you have 30 tabs open, how do you get back to the page you were on? To me, it's like inviting friends around, offerering them a coffee - and when they say yes, you beam them (Star Trek style) to a cafe on the other side of the world... with no map for them to get back
2. The best approach is to forget about it. If your visitors want to open a link in a new tab or window, they can - without your help...
But, if you must, there are ways... but I ain't telling
3. See htmlhelp.com: Choosing a DOCTYPE for a detailed
James
QUOTE(lavazza @ Jul 2 2007, 08:50 PM) *

QUOTE(James @ Jul 2 2007, 11:52 PM) *
1. Why is the attribute, "target", deleted from version 4.01 strict?
2. With 4.01 Strict, how do I get a link to open in a new page?
3. What is the best version to use if one is currently building a site? - Strict? - or Transitional?

1. It is to be 'deprecated' for a few reasons. The #1 in my book: it is really, really annoying! If you follow such a link and you have 30 tabs open, how do you get back to the page you were on? To me, it's like inviting friends around, offerering them a coffee - and when they say yes, you beam them (Star Trek style) to a cafe on the other side of the world... with no map for them to get back
2. The best approach is to forget about it. If your visitors want to open a link in a new tab or window, they can - without your help...
But, if you must, there are ways... but I ain't telling
3. See htmlhelp.com: Choosing a DOCTYPE for a detailed


Thanks for that information

I can see your point about opening links in new browsers. However, I only every go one level up in that direction. For example, I will have a link to our local government page so non-locals can browse that site for information. Using the "target" attribute I can advise my visitors to simply close the page to return to my site. How would you suggest they find their way back from an outside site if we don't use the target attribute? - I suppose they could use the back button, clicking on it once for every page they looked at on the government site.

I read the "Choosing a DOCTYPE" article, thank you. It seems like "Strict" might augur well for well set out pages and longevity - do you agree?

Many thanks, James
Corey Bryant
Target Not Allowed in XHTML - Using JavaScript might help
pandy
What if the user lets new windows open as tabs as lavazza does? Then the close the window and go back to the orignal page copncept doesn't work.

With Strict, if you must open a new window you do it with JavaScript. And you should do it the right way, with the URL in the href.
http://htmlhelp.com/faq/html/links.html#window-specify
pandy
PLEASE, don't double post! Threads merged.
Darin McGrew
QUOTE(James @ Jul 2 2007, 04:50 AM) *
1. Why is the attribute, "target", deleted from version 4.01 strict?
The target attribute, like all other frame-related markup, is not available in the Strict DTDs.

The reply mentioning XHTML is misleading. HTML vs XHTML is irrelevant. All that matters is Strict DTD vs Transitional DTD vs Frameset DTD.

QUOTE(James @ Jul 2 2007, 04:50 AM) *
2. With 4.01 Strict, how do I get a link to open in a new page?
The best choice is to let your visitors open new windows on their own, if/when they want them.

If you insist on doing it for them, then JavaScript is your only option with Strict.

QUOTE(James @ Jul 2 2007, 04:50 AM) *
3. What is the best version to use if one is currently building a site? - Strict? - or Transitional?
What are you transitioning from? Do you have legacy documents that you're still transitioning from tag-soup markup to standard markup?

For personal work, I use a custom DTD that is a copy of Strict, with a couple changes to allow <base target="_top">. Elsewhere, I use Strict.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.