I knew there was one error I had while changing from transitional to strict that I’d forgotten; it was this: “target is not an attribute.”
My original (transitional) page had this (double-spacing in
an effort to prevent horizontal scrolling):
[code]
<p>You can find my nonsensical<a href=”collapse.htm”
target=”_blank”> Collapsing Boxes </a>
on a page that will open a new browser window.</p>
In order to validate the page as strict HTML, I removed the
target=”_blank”
And the file validated as strict.
I did sort of wonder about that usage. In this particular situation, since the target is on my same site, I don’t think it matters a lot. But on a couple of pages, I link to other sites, and use the same instruction.
Is that something very different, and might that validate, when this version, linking to the same site, doesn’t? (in strict HTML 4.01).
Can anyone perceive what I’m not understanding? <haha!>
Is there some other way I can or should handle this?
Thanks!
Sat, 29 Jan 2005 23:04:51
[i]Originally posted by Charles [/i]
[B][font=monospace]<p>You can find my nonsensical <a href="collapse.htm" oncick="window.open (this.href, 'child'); return false">Collapsing Boxes</a>
on a page that will open a new browser window.</p>[/font]
And please note, Browsers are expected to normalize white space by removing it at the beginning and the end of an element. Be sure to use: [font=monospace]<p>Hello, <em>World!</em>[/font] in place of [font=monospace]<p>Hello,<em> World!</em>[/font]. [/B][/QUOTE]
[i]Originally posted by Charles [/i]
[B][font=monospace]<p>You can find my nonsensical <a href="collapse.htm" oncick="window.open (this.href, 'child'); return false">Collapsing Boxes</a>
on a page that will open a new browser window.</p>[/font]
And please note, Browsers are expected to normalize white space by removing it at the beginning and the end of an element. Be sure to use: [font=monospace]<p>Hello, <em>World!</em>[/font] in place of [font=monospace]<p>Hello,<em> World!</em>[/font]. [/B][/QUOTE]
[i]Originally posted by CarolW [/i]
[B]In order to validate the page as strict HTML, I removed the
target="_blank"
And the file validated as strict.[/B][/QUOTE]
[i]Originally posted by Charles [/i]
[B][font=monospace]<p>You can find my nonsensical <a href="collapse.htm" oncick="window.open (this.href, 'child'); return false">Collapsing Boxes</a>
on a page that will open a new browser window.</p>[/font][/B][/QUOTE]
[i]Originally posted by phpnovice [/i]Not at all; that's the desired outcome. Those of us who are happy and JavaScript free will be able to use the link but will not be forced to have a new window.
[B]I guess Charles doesn't mind suggesting code to you that [u][i]won't open[/u] in a [u]new[/u] window[/i] for 10%-12% of the potential visitors to your site. [/B][/QUOTE]
[i]Originally posted by phpnovice [/i]
[B]I don't know why the PTB decided to remove [B]target[/B] from HTML 4.01. To my understanding, they did not even include it in the Frameset DTD -- where [B]target[/B] is most useful/needed. Also to my understanding, you will only find [B]target[/B] in the Transitional DTD. ? [/B][/QUOTE]
[i]Originally posted by MstrBob [/i]
[B]The target attribute is used to specify a frame target.[/B][/QUOTE]
[i]Originally posted by MstrBob [/i]
[B]The Frameset DTD is actually a modified Transitional DTD. If you take a loot at it, they define the FRAMESET element and then include the Transitional DTD. Therefor, you can use the target attribute for frames, which was the original intention.[/B][/QUOTE]
[i]Originally posted by CarolW [/i]
[B]1) Is that Javascript - that "onclick" directive? IF so, waht do I put in the <head> area of my document to allow it?[/B][/QUOTE]
[i]Originally posted by CarolW [/i]
[B]Seems to me I read somewhere that there are a few commands of just this sort that don't require Javascript, and perhaps "onclick" is one of them. (Says me, hoping, but doubtful.)[/B][/QUOTE]
[i]Originally posted by CarolW [/i]
[B]That "this href" isn't exactly what's needed there, is it? Does it stand for something more specific?[/B][/QUOTE]
[i]Originally posted by Charles [/i]
[B]Not at all; that's the desired outcome. Those of us who are happy and JavaScript free will be able to use the link but will not be forced to have a new window.
The handler "onclick" itself is defined in the HTML spec. but you use it to assign some script to the handler. To use it you need to put something like the following in your document's HEAD element to specify whata kind of script you will be using:
[font=monospace]<meta name="Content-Script-Type" content="text/javascript">[/font]
The[url=http://www.w3.org/TR/html401/struct/text.html#edef-EM]EM[/url] element denotes emphasis, the[url=http://www.w3.org/TR/html401/struct/text.html#edef-STRONG]STRONG[/url] element denotes strong emphasis and the[url=http://www.w3.org/TR/html401/struct/text.html#edef-P]P[/url] element denotes a paragraph. Seehttp://www.w3.org/TR/html401/index/elements.html . [/B][/QUOTE]
[i]Originally posted by phpnovice [/i]
[B]If you want JavaScript then, technically, you don't absolutely need to specify anything in the HEAD section of your document as JavaScript is the default. [/B][/QUOTE]
[i]From the HTML 4.01 Strict:[/i]
[b]Authors should specify the default scripting language for all scripts in a document by including the following META declaration in the HEAD:
[font=monospace]<META http-equiv="Content-Script-Type" content="type">[/font]
where "type" is a content type naming the scripting language. Examples of values include "text/tcl", "text/javascript", "text/vbscript".
In the absence of a META declaration, the default can be set by a "Content-Script-Type" HTTP header.
[font=monospace]Content-Script-Type: type[/font]
where "type" is again a content type naming the scripting language.
User agents should determine the default scripting language for a document according to the following steps (highest to lowest priority):
1. If any META declarations specify the "Content-Script-Type", the last one in the character stream determines the default scripting language. 2. Otherwise, if any HTTP headers specify the "Content-Script-Type", the last one in the character stream determines the default scripting language.
Documents that do not specify default scripting language information and that contain elements that specify an intrinsic event script are incorrect. User agents may still attempt to interpret incorrectly specified scripts but are not required to. Authoring tools should generate default scripting language information to help authors avoid creating incorrect documents.[/b]
[i]http://www.w3.org/TR/html401/interact/scripts.html#h-18.2.2 [/i][/quote]
[i]Originally posted by phpnovice [/i]And to that I give a hardy Bovine Excrement. If they were then we would be able to code to the single spec and all browsers would work correctly. Or is it that you prefer the chaos as a form of job security?
[B]It is a good and excellent thing that browser manufacturer's aren't as anal-retentive as those that draft such documents nor as those that feel the need to post them. [/B][/QUOTE]
[i]Originally posted by ray326 [/i]
[B]Or is it that you prefer the chaos as a form of job security? [/B][/QUOTE]
[i]Originally posted by phpnovice [/i]
[B]
<snip>
I'll not reply further to this thread as, from experience, such replies are futile.
Cheers. [/B][/QUOTE]
[i]Originally posted by CarolW [/i]
[B]Well, please don't go away. I'll look for you in other threads.[/B][/QUOTE]
[i]Originally posted by CarolW [/i]
[B]I miss target="_blank" - but neither you nor Charles responded to that aspect of my question.[/B][/QUOTE]
[i]Originally posted by Charles [/i]
[B]...they are working on[url=http://www.w3.org/TR/xframes/]XFrames[/url] , the next upgrade. [/B][/QUOTE]
0.1.9 — BETA 6.16