S
shypen42
Hi,
I'd like to know how to serve web pages as "cleanly" as possible,
maybe validating them if it's possible. How should I do to
both respect standards *and* have it work under the various
IE versions?
Is there a "best practice" regarding the content type of a web page
using quite some amount of Javascript (and "AJAX"-server querying)?
Here are three examples:
1. XHTML 1.0 Transitional, content="text/html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>script.aculo.us - web 2.0 javascript</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
2. XHTML 1.0 Strict, content="text/html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Openweb.eu.org - L'objet XMLHttpRequest</title>
<meta http-equiv="Content-type" content="text/html;
charset=utf-8"/>
3. XHTML 1.1, content="application/xhtml+xml"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="application/xhtml+xml;
charset=utf-8" />
Now I've read this:
http://hixie.ch/advocacy/xhtml
"Sending XHTML as text/html Considered Harmful"
And then some guy replying to the following affirmation:
++ there is ONLY ONE valid Content-type for XHTML content,
++ and that is application/xml+xhtml, not text/html.
- This is simply not true. RFC 2854 [ietf.org], the definition of
- text/html, explicitly permits XHTML 1.0 documents that
- follow Appendix C to be transmitted as text/html.
- Doing so causes Mozilla and Opera to parse it as HTML and
- not XHTML, but that doesn't mean it's "invalid" or non-standard
- in any way.
So what would you recommend, what is currently seen
as "best practices" knowing that some Javascript is
used (in an "buzzwordy-AJAX-fashion")?
I'd like to know how to serve web pages as "cleanly" as possible,
maybe validating them if it's possible. How should I do to
both respect standards *and* have it work under the various
IE versions?
Is there a "best practice" regarding the content type of a web page
using quite some amount of Javascript (and "AJAX"-server querying)?
Here are three examples:
1. XHTML 1.0 Transitional, content="text/html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>script.aculo.us - web 2.0 javascript</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
2. XHTML 1.0 Strict, content="text/html"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Openweb.eu.org - L'objet XMLHttpRequest</title>
<meta http-equiv="Content-type" content="text/html;
charset=utf-8"/>
3. XHTML 1.1, content="application/xhtml+xml"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="application/xhtml+xml;
charset=utf-8" />
Now I've read this:
http://hixie.ch/advocacy/xhtml
"Sending XHTML as text/html Considered Harmful"
And then some guy replying to the following affirmation:
++ there is ONLY ONE valid Content-type for XHTML content,
++ and that is application/xml+xhtml, not text/html.
- This is simply not true. RFC 2854 [ietf.org], the definition of
- text/html, explicitly permits XHTML 1.0 documents that
- follow Appendix C to be transmitted as text/html.
- Doing so causes Mozilla and Opera to parse it as HTML and
- not XHTML, but that doesn't mean it's "invalid" or non-standard
- in any way.
So what would you recommend, what is currently seen
as "best practices" knowing that some Javascript is
used (in an "buzzwordy-AJAX-fashion")?