Jump to content

The <base> Element.


atar.yosef

Recommended Posts

Hello there!!!I noticed that the W3C removed the attribute "target" of the <base> element from their strict HTML specification, and leave only its "href" attribute and my question is if there is a way to duplicate the functionality of the "target" attribute also according to the strict specification.I will be happy to get the users' opinion.

Link to comment
Share on other sites

The target attribute was originally designed to add functionality to framesets. Since frames are now deprecated, so is the target attribute. (This is true even though the target attribute does other things also.)Here is another reason for getting rid of targets. What the target attribute accomplishes can be described as behavior. It is not semantic, since it doesn't describe any page content. But it is also not presentational. It doesn't change the look of a page. What it does is either change the input focus or open a new window. This is behavior.Behavior is best left to JavaScript. Fortunately, all the functionality you expect from the target attribute can be handled with JavaScript.The reason it wasn't always this way is that frames and JavaScript were invented by Netscape at roughly the same time, and this was before the current model of web documents had been standardized. Even at the time, many people thought that frames were a mistake, and time has proven this true.The inline frame remains useful. Its best use is for content that does not change in any meaningful way. This is so that a user can use the back button or bookmark the page and always return to the same content.An inline frame can also be used as a work-around for a few problems that still exist in HTML, especially HTML forms. Most experienced developers will tell you that they do not like using inline frames in this way, and they would stop doing it if the problems were corrected. (Please don't ask what the problems are. The explanation is long. :) )

Link to comment
Share on other sites

The target attribute was originally designed to add functionality to framesets. Since frames are now deprecated, so is the target attribute. (This is true even though the target attribute does other things also.)Here is another reason for getting rid of targets. What the target attribute accomplishes can be described as behavior. It is not semantic, since it doesn't describe any page content. But it is also not presentational. It doesn't change the look of a page. What it does is either change the input focus or open a new window. This is behavior.Behavior is best left to JavaScript. Fortunately, all the functionality you expect from the target attribute can be handled with JavaScript.The reason it wasn't always this way is that frames and JavaScript were invented by Netscape at roughly the same time, and this was before the current model of web documents had been standardized. Even at the time, many people thought that frames were a mistake, and time has proven this true.The inline frame remains useful. Its best use is for content that does not change in any meaningful way. This is so that a user can use the back button or bookmark the page and always return to the same content.An inline frame can also be used as a work-around for a few problems that still exist in HTML, especially HTML forms. Most experienced developers will tell you that they do not like using inline frames in this way, and they would stop doing it if the problems were corrected. (Please don't ask what the problems are. The explanation is long. :) )
I'm again amazing from your detailed clear answers and thanks you very much!! But still, a little question was remained- why the W3C didn't cancel also the "href" attribute of the <base> tag? and generally, this attribute (href) of the <base> tag seem to be very not usefull and needless, because who want to link all his links to the same address? By the way, it seem that you yourself is a very experienced and professional web developer since you show a deep comprehension at the web development languages.However, thanks you about your clear and detailed answer!! :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...