who uses virtual pc for testing webpages

O

Owen Jacobson

"Using HTML Comments to hide JavaScript Code

"The comment tags cause the JavaScript statements to be treated as
comments by JavaScript-challanged browers. JavaScript-enabled browsers
on the other hand, know enough to ignore the comments tags and process
the enclosed statements as JavaScript."

(HTML Complete (ISBM 0-7821-2421-2467-4) pg 554)

Applies to constructs like
<script type="text/javascript">
<!--
// some code
// -->
"Documents that do not specify default scripting language information
and that contain elements that specify an intrinsic event script are
incorrect." (18.2.2 Specifying the scripting language)
<http://tinyurl.com/2j28>

Applies to said:
As I said before nonstandard garbage and I have TWO QUOTED sources to
back me up. The only refutiation allowable now is QUOTED soucres that
say the above is correct. In short you lose.

You've found sources that appear, to you, back up an assumption that
doesn't actually mesh with reality. The example Toby and Eric have been
using *is* *not* javascript, a fact which should be obvious just from the
syntax of the comments in question. It's not really a scripting language
at all: the syntax is extremely limited, and isn't even close to Turing
completeness.

It is a browser-specific extension, in that IE will handle that particular
markup by including the contained elements. However, in an unusual stroke
of brilliance, Microsoft has implemented it in a way that will not disturb
standards-compliant browsers in the slightest: to most browsers, those
examples appear *strictly* as comments -- content between <!-- and --> to
be ignored completely during rendering.
 
E

Eric B. Bednarz

Bruce Grubb said:
HTML Complete (ISBM 0-7821-2421-2467-4) pg 554

In fact this section is CALLED "Using HTML Comments to hide JavaScript Code"

"The comment tags

Oh dear. There's no such thing like "comment tags". Ask your money
back.
cause the JavaScript statements to be treated as coments
by JavaScript-challanged browers.

As a matter of fact, it requires SGML-challenged browsers (as you would
be able to understand by now if you had read any of the referenced
resources in this thread). Obviously you are way too smart to be
interested in or learn from reactions on your, uhm, theories.

EOD for me, HANL
 
B

Bruce Grubb

Owen Jacobson said:
Applies to constructs like
<script type="text/javascript">
<!--
// some code
// -->


Applies to <script> elements and onEvent handlers, which this is also not.

As I explained before '18.3.2 Hiding script data from user agents' renders
Conditional Comments as NONSTANDARD garbage.

"As HTML does not rely on a specific scripting language, document authors
must explicitly tell user agents the language of each script. This may be
done either through a default declaration or a local declaration. [...]
Documents that do not specify default scripting language information and
that contain elements that specify an intrinsic event script are incorrect."

Conditional Comments is simply MSspeak for scrip-like element that don NOT
follow the HTML specs for scripts. You can to handwave it but that is what
it boils down to.


It is a browser-specific extension

Which makes it NONSTANDARD garbage and invalid by the specs since "HTML
does not rely on a specific scripting language"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body><!--[if gte IE 5]><input type example><![endif]--></body>

The above does not use the script element as required by 18.2.1 for ALL
scripts and script-like fuctions, it does not use the required type
=content-type [CI] element, and there is no character that comments out the
ending --> which as all three examples in 18.3.2 imply is also required.

In short is NONSTANDARD crap and no matter how you handwave it is will
remain NONSTANDARD crap.
 
O

Owen Jacobson

As I explained before '18.3.2 Hiding script data from user agents'
renders Conditional Comments as NONSTANDARD garbage.

"As HTML does not rely on a specific scripting language, document
authors must explicitly tell user agents the language of each script.
This may be done either through a default declaration or a local
declaration. [...] Documents that do not specify default scripting
language information and that contain elements that specify an intrinsic
event script are incorrect."
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body><!--[if gte IE 5]><input type example><![endif]--></body>

Which, by the strictest possible parsing, is exactly equivalent to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body></body>

I'm not seeing a problem here.
 
T

Toby A Inkster

Bruce said:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body><!--[if gte IE 5]><input type example><![endif]--></body>

Look. It validates. It doesn't use Javascript or Java or for that matter
even CSS. It doesn't break any normative part of the HTML spec. It is
standard HTML.
It is not a feature as it violates HTML 4.01's section on scripts
<http://tinyurl.com/34lbd>

a) who cares if it does - it's an HTML 3.2 document, not HTML 4.01.
b) it doesn't anyway.
The above does not use the script element as required by 18.2.1

It doesn't need to use the <script> element. Only scripts need the
<script> element. It is not a script.

The example is valid whether you like it or not.
 
B

Bruce Grubb

Owen Jacobson said:
As I explained before '18.3.2 Hiding script data from user agents'
renders Conditional Comments as NONSTANDARD garbage.

"As HTML does not rely on a specific scripting language, document
authors must explicitly tell user agents the language of each script.
This may be done either through a default declaration or a local
declaration. [...] Documents that do not specify default scripting
language information and that contain elements that specify an intrinsic
event script are incorrect."
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body><!--[if gte IE 5]><input type example><![endif]--></body>

Which, by the strictest possible parsing, is exactly equivalent to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body></body>

I'm not seeing a problem here.

The former causes certain PC broswers to crash while the later doesn't.
Next question.
 
B

Bruce Grubb

Mark Parnell said:
And yet both validate.

Only because the validator ignores the COMMENTED stuff like it is supposed
to.

As I tried explain to by citing '18.3.2 Hiding script data from user
agents' a HTML validator will NOT check for script integrity.

"As HTML does not rely on a specific scripting language, document authors
must explicitly tell user agents the language of each script. This may be
done either through a default declaration or a local declaration. [...]
Documents that do not specify default scripting language information and
that contain elements that specify an intrinsic event script are incorrect."

I should mention that if the people defending this idiocy had bothered to
actually LOOK at the spec they would have found HTML 4.01 spec actually
defines what a script its:

"a program that may accompany an HTML document or be embedded directly in
it. The program executes on the client's machine when the document loads,
or at some other time such as when a link is activated. HTML's support for
scripts is independent of the scripting language."
<http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.1>

conditional comments fit this to a 'T'. Per the specs HTML 3.2 is NOT
supposed to do scripts in ANY manner while HTML 4.01 is. Per 4.01 specs:

1) ALL scripts MUST use the script element.

2) The Type=content-type [CI] element is REQUIRED for ANY script.

3) From the examples given it is clear that a character particular
to that scripting lanuage MUST be used to comment out the ending -->
if the script is commented out so older browsers do not
renderer it as text.

4) Must take note of KNOWN issues

"Some browsers close comments on the first ">" character, so to hide script
content from such browsers, you can transpose operands for relational and
shift operators (e.g., use "y < x" rather than "x > y") or use scripting
language-dependent escapes for ">"."
<http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.3.2>


Back to the idiotic NONSPEC example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<title>Example</title>
<body><!--[if gte IE 5]><input type example><![endif]--></body>

and get it closer to following HTML 4.01 specs.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<title>Example</title>
<body>
<SCRIPT type="text/conditionalcomment">
<!--[if gte IE 5]>
<input type example>
<![endif]
//whatever comment character conditional comment scripts use//-->
</SCRIPT>
<NOSCRIPT>
<P>I am sorry your browswer does not support conditional comments</p>
</NOSCRIPT>
</body>

Now the problems with conditional comments becomes all too clear.

1) Scripts as such are NOT defined in HTML 3.2 so we had to kick the
document to HTML 4.01 to use the script element.
<http://www.w3.org/TR/REC-html32.html#script>

2) As per the warning on 18.3.2 some browsers may close the comment too
early. The ending ">"s need to be commented out per the spec.

3) Doing the script this way shows another problem. Under HTML 4.01 a '<'
is NOT supposed to be used WITHIN a script as this can cause all sorts of
problems.
Hence it is obvious that testing on various browsers is necessary.

Hence writing to ALL of HTML 4.01 specs rather than to the OBSOLETE HTML
3.2 specs and using broswer specific garbage (ie conditional comments) used
under HTML 3.2 is necessary.

In fact conditional comments are NONSTANDARD garbage under HMTL 3.2 because
scripts and script like behavior are not defined and were slated for a
FUTURE version of HTML. Since scripts are not defined in HTML 3.2
conditional comments will validate them but that does NOT mean the pages is
truely following the HTML 3.2 spec. Any HTML page that uses scripts in ANY
form must used HTML 4.01 and those guidelines show the flaws with
conditional comments.

Finally conclusion. Validate the HTML but also check the spec to make sure
you are not exploiting a loophole in the validaters (which conditional
comments do.)
 
T

Toby A Inkster

Bruce said:
Only because the validator ignores the COMMENTED stuff like it is supposed
to.

As should browsers.

But this is the root of the problem: sometimes (most of the time!)
browsers aren't as strict as the HTML validator, which is why testing *is*
required.
As I tried explain to by citing '18.3.2 Hiding script data from user
agents' a HTML validator will NOT check for script integrity.
[...]

And blah, blah, blah about scripts. Except the page in question[1] DOES
NOT CONTAIN ANY SCRIPTS.
Now the problems with conditional comments becomes all too clear.

1) Scripts as such are NOT defined in HTML 3.2 so we had to kick the
document to HTML 4.01 to use the script element.
<http://www.w3.org/TR/REC-html32.html#script>

Firstly, I'm not using any scripts.

Secondly, the document isn't HTML 4.01. It's HTML 3.2.
2) As per the warning on 18.3.2 some browsers may close the comment too
early. The ending ">"s need to be commented out per the spec.

Firstly, 18.3.2 applies to the <script> element, which isn't used on this
page.

Secondly, it applies to HTML 4.01. I'm using HTML 3.2.
3) Doing the script this way shows another problem. Under HTML 4.01 a
'<' is NOT supposed to be used WITHIN a script as this can cause all
sorts of problems.

Firstly, I'm not using any scripts.

Secondly, I'm using HTML 3.2, not HTML 4.01.

Thirdly, this is FALSE even for HTML 4.01.

[1] which can be found here, for those not following the thread:
http://www.goddamn.co.uk/tobyink/scratch/example
 
N

Nick Kew

Toby A Inkster said:
[1] which can be found here, for those not following the thread:
http://www.goddamn.co.uk/tobyink/scratch/example

Erm, and what was the original point that page was designed to
demonstrate? FWIW, my browser correctly displays a blank page.
I think the post up to which you just followed was complaining
of the idiocy of a browser assigning meaning to (any of) the
content of your comment.
 
B

Bruce Grubb

Toby A Inkster said:
[1] which can be found here, for those not following the thread:
http://www.goddamn.co.uk/tobyink/scratch/example

Erm, and what was the original point that page was designed to
demonstrate?

That using command comments can crash some browsers but the page validates
as valid HTML 3.2.
FWIW, my browser correctly displays a blank page.
I think the post up to which you just followed was complaining
of the idiocy of a browser assigning meaning to (any of) the
content of your comment.

It was that as well lamblasting the use of conditional comments. By the
defintions HTML 4.01 lays out conditional comments ARE scripts:

"a program that may accompany an HTML document or be embedded directly in
it. The program executes on the client's machine when the document loads,
or at some other time such as when a link is activated. HTML's support for
scripts is independent of the scripting language."
<http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.1>

It is a simple syllogism (Aristotlian logic):

1) a program that executes on the client's machine when the
document loads is a script (defined in HTML4.01 section 18)

2) conditional comments are commented out commands that
execute on the client's machine when the document
is load by a IE browser.

3) ergo conditional comments ARE scripts reguardless of
how those who write IE browsers want to handwave it.

If it looks like a duck, quacks like a duck, and acts like a duck than it
sure as blazes is not a freaking elephant.


Conditional comments validate simply because under HTML 3.2 there are not
supposed to be scripts in ANY form and treats the thing as a comment per
the spec.

The problem is some browsers see this little piece of stupidity as a script
and try to execute the thing. By HTML 3.2 specs this is a NO-NO and any
web page author that does this should get rightly lamblaster for exploiting
a nonstandard implimention of HTML 3.2.

Even though they validate conditional comments are bad HTML because they
are a nonstandard implimention. Scripts and script-like behavior are
supposed to be the province of HTML 4.01 not HTML 3.2.

Here is the post that started this:

Do you think these two are mutually exclusive? The following page:

http://www.goddamn.co.uk/tobyink/scratch/example >
is 3 lines of validated HTML with no CSS and no Javascript. Simple enough,
right? But it will instantly crash about 85% of your visitors' browsers.
Go ahead: visit it in IE 5+ for Windows. Just make sure you've saved any
work you were doing first.

----

The reason the page crashes even though it validates is simple.

Conditional comments are a broswer specific form of script. Not only does
this violate the basic premice that a validated HTML page will fuction the
same regardless of what broswer you are viewing it with but it violates the
concept that script and script-like elements are supposed to be in HTML
4.01.

I should mention that a validator is only ONE of the things one should use
to make sure the page is valid. The other is reading the specs and
understanding what they are saying between the lines. Read that way it is
clear that scripts and script-like behavior are to be done in HTML 4.01
pages and only in a certain way. Anything else even if it validates is
nonstandard HTML.
 
N

Neal

I think the post up to which you just followed was complaining
of the idiocy of a browser assigning meaning to (any of) the
content of your comment.

"up to which you just followed" = "you just followed up"?!?

Did you know, it's really OK to end a sentence with a preposition?

Unless you were paraphrasing the gag in Beavis And Butthead Do America, in
which case never mind.
 
N

Neal

I should mention that a validator is only ONE of the things one should
use
to make sure the page is valid. The other is reading the specs and
understanding what they are saying between the lines.

Who is the arbiter of what is between the lines? All I get are margins and
padding.
 
T

Toby A Inkster

Neal said:
"up to which you just followed" = "you just followed up"?!?

Did you know, it's really OK to end a sentence with a preposition?

In general I think ending a sentence with a preposition is clumsy, but in
this case it's the lesser of two evils.
 
T

Toby A Inkster

Bruce said:
2) conditional comments are commented out commands that
execute on the client's machine when the document
is load by a IE browser.

They're not though. Conditional comments don't have any "commands". They
don't "do" anything.

Rather than saying "do this, do that", they say "this bit is suitable only
for IE >= 5.0".

That is: not scripts, but markup.
If it looks like a duck, quacks like a duck, and acts like a duck than
it sure as blazes is not a freaking elephant.

They're the ugly duckling. Look like ducks, quack like ducks, but they're
geese.
Conditional comments validate simply because under HTML 3.2 there are
not supposed to be scripts in ANY form and treats the thing as a comment
per the spec.

This is nonsense. The version of HTML I used has nothing to do with it: it
was an entirely arbitrary decision. The same effect can be seen in any
version of HTML:

http://www.goddamn.co.uk/tobyink/scratch/example-html401
http://www.goddamn.co.uk/tobyink/scratch/example-html2
http://www.goddamn.co.uk/tobyink/scratch/example-xhtml11
http://www.goddamn.co.uk/tobyink/scratch/example-none

All valid. All IE/Win killers.
 
R

rf

Not at all. Not in the Queens language.
In general I think ending a sentence with a preposition is clumsy, but in
this case it's the lesser of two evils.

Er, sorry, just dropped into this thread by mistake but what is wrong with
the following sentence?:

<quote>
Would you like to come up to my attic to look at my etchings?
</quote>

....same answer, one must not end a sentence with a proposition.

Cheers
Richard.
 
B

Brian

rf said:
...


Not at all.

In each of the following pairs of sentences, pick the one which is
clearer:

1a. "What are you looking at?"
1b. "At what are you looking?"

2a. "Here's the book I was looking for."
2b. "Here's the book for which I was looking."

3a. "His behavior is not something I'll put up with."
3b. "His behavior is not something up with which I'll put."

(3 adapted from Winston Churchill's famous note to an editor.)
Not in the Queens language.
http://www.grammarphobia.com/grammar.html

http://www.yourdictionary.com/library/drlang001.html

http://darkwing.uoregon.edu/~spike/ling290/badEnglish.html

Er, sorry, just dropped into this thread by mistake but what is
wrong with the following sentence?:

<quote> Would you like to come up to my attic to look at my
etchings? </quote>

...same answer, one must not end a sentence with a proposition.

After reading this, I'm starting to wonder if my irony detector needs
servicing.
 
B

Bruce Grubb

Toby A Inkster said:
They're not though. Conditional comments don't have any "commands". They
don't "do" anything.

Yes they do
<http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>

Goes into great detail and show these things just don't sit there.

Rather than saying "do this, do that", they say "this bit is suitable only
for IE >= 5.0".

In short THEY DO do something - they tell the broswer to behave a certain
way. fits the following to the 'T':

"a program that may accompany an HTML document or be embedded directly in
it. The program executes on the client's machine when the document loads,
or at some other time such as when a link is activated. HTML's support for
scripts is independent of the scripting language."
<http://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.1>

It is a simple syllogism (Aristotlian logic):

1) a program that executes on the client's machine when the
document loads is a script (defined in HTML4.01 section 18)

2) conditional comments are commented out commands that
execute on the client's machine when the document
is load by a IE browser.

3) ergo conditional comments ARE scripts reguardless of
how those who write IE browsers want to handwave it.
That is: not scripts, but markup.

"Conditional comments are processed during the downloading and parsing
^^^^^^^^^^^
phase, so only the content that is targeted for the browser loading the Web
page is actually downloaded. Conditional comments can be combined freely
with other browser detection techniques."

Remember my FIRST comment on this piece of stupity?:

HTML 4.0.1 is a STANDARD. As long as you write to the standard (opposed
to exploiting bugs or quirks in Netscape and Explorer) you don't NEED to go
testing your HTML on multiple browsers.


{for what it is world i consider the support of Conditional comments a
quirk.)
They're the ugly duckling. Look like ducks, quack like ducks, but they're
geese.

But they do not ACT like duck now do they?

This is nonsense. The version of HTML I used has nothing to do with it: it
was an entirely arbitrary decision. The same effect can be seen in any
version of HTML:

http://www.goddamn.co.uk/tobyink/scratch/example-html401

Invald for reasons I have explained previously.

And here I thought VPenman over in the 'CR2 Expansion Bug/Feature' was the
only example of how to use windows to totally FUBAR the HTML standard.
At least *he* did his idiocy out of ignorance.

All valid. All IE/Win killers.

All if you follow the logic using a script like thing that should not be
there. Besides work fine with IE for the Mac; I though you Windose users
kept saying it can do EVERYTHING the MacOS can do. So why can't it do this
page right? HMMM.
 
T

Toby A Inkster

Bruce said:
In short THEY DO do something - they tell the broswer to behave a
certain way.

By that logic, the '<i>' tag is also a script: as it tells the browser to
behave a certain way (start using italics).

Reductum ad absurdum, the single character 'z' is a script because it
tells the browser to behave a certain way (draw a 'z')

The fact of the matter is, telling the browser to do something does not
imply a script. The usual definition of a scripting language implies
almost Turing completeness: for practical purposes, the ability to write
loops and branches and use variables. One would also usually include weak
typing in the definition of a scripting language.

Conditional comments meet none of these requirements, so are not a
scripting language.

Conditional comments say "this bit is suitable for IE version X" and "end
of that bit". They are simply beginning and end markers that attach some
kind of property to the data between them. There is a word for such
things: that word is "markup".

The fact is, the page in question[1] obeys the standard to the letter, but
crashes IE. This is just one such example too: it is perfectly easy to
write web pages that obey standards perfectly yet perform badly in some
browser or another. By "perform badly" I mean a number of things, from
minor display niggles through to completely illegible pages and even
browser crashes.

So writing to the standards isn't enough (although it's a good place to
begin). Browser testing is necessary.
"Conditional comments are processed during the downloading and parsing
^^^^^^^^^^^
phase,

So what? The whole page is processed. That's what a browser does.
for what it is world i consider the support of Conditional comments a
quirk.

For what it is world (sic) so do I. They do come in handy sometimes though.
Besides work fine with IE for the Mac; I though you Windose users
kept saying it can do EVERYTHING the MacOS can do.

I'm a Windows user now, am I?


[1] http://www.goddamn.co.uk/tobyink/scratch/example
 
S

Samuël van Laere

http://www.goddamn.co.uk/tobyink/scratch/example >
is 3 lines of validated HTML with no CSS and no Javascript. Simple enough,
right? But it will instantly crash about 85% of your visitors' browsers.
Go ahead: visit it in IE 5+ for Windows. Just make sure you've saved any
work you were doing first.

Didn't crash on my system:
Win98SE and IE5.5 SP2 all updated with M$'s latest "patches" available.
To bad they stopped supporting Win98 though, many people still use it.

Regards,
Samuël
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,190
Latest member
ClayE7480

Latest Threads

Top