Click to See Complete Forum and Search --> : whats the point


The Cheat
04-21-2004, 12:05 AM
whats the point in putting
<meta http-equiv="content-script-type" content="text/javascript" />
and
<meta http-equiv="content-style-type" content="text/css" />
in your <head> ?


thanks

Daniel T
04-21-2004, 12:08 AM
SEO

The Cheat
04-21-2004, 12:09 AM
O

Daniel T
04-21-2004, 12:10 AM
Originally posted by The Cheat
O
LOL! I didn't think any reply could get shorter than mine, but you proved me wrong! :p
-Dan

The Cheat
04-21-2004, 12:11 AM
ok another random question, when using an xhtml doctype, does it matter whether i use <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" /> or <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
Which is better to use and why or does it even matter??

The Cheat
04-21-2004, 12:12 AM
Originally posted by DanieLTomaS
LOL! I didn't think any reply could get shorter than mine, but you proved me wrong! :p
-Dan
:D

Daniel T
04-21-2004, 12:12 AM
Originally posted by The Cheat
ok another random question, when using an xhtml doctype, does it matter whether i use <meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1" /> or <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> The first one is probly better, because it describes the doctype better.
-Dan

fredmv
04-21-2004, 06:07 AM
Actually the first two set of <meta> elements define default scripting and style languages because not all browsers default to JavaScript and CSS, even if it may seem like that. This simply ensures that they do though I would probably still include the type attributes if they are required by your DOCTYPE.

Secondly, if you are using an XHTML DOCTYPE it would be better to use the former of the two tags. This, however, does not ensure that your page will be sent truly as an application of XML. For that to happen you must make sure via server-side. Further information on this can be found in Mark Pilgrim's excellent article The Road to XHTML 2.0: MIME types (http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html).

pyro
04-21-2004, 08:49 AM
Additionally, by setting the default scripting and style languages, it will ensure that inline scripts/styles are interpreted correctly.

Robert Wellock
04-21-2004, 08:54 AM
The last two answers were more correct than SEO.

The Cheat
04-21-2004, 03:40 PM
thanks guys you rock

The Cheat
04-23-2004, 12:28 AM
ANOTHER DUMB QUESTION:

when you make a xhtml document. Should i save it as index.html, or index.xhtml

For some reason i always assumed you saved html and xhtml both as .html regardless. However, now im just curious, can you save xhtml as .xhtml-or are you supose to save as .html? Does it even matter... thanks.

:D

fredmv
04-23-2004, 12:33 AM
Originally posted by The Cheat
when you make a xhtml document. Should i save it as index.html, or index.xhtml It doesn't make a difference it can be .html, .php — whatever. What really matters is that you're using valid markup in the said file and, moreover, this is even more important if you're sending the page as an application of XML (since that's the XHTML is). For an more on this on this check the excellent aforementioned article.

Further, you could actually configure your server to automatically send files with a certain extension (e.g., .xhtml) with the application/xhtml+xml MIME type which is what XHTML should be sent as. I believe this is as simple as adding a few AddType lines to Apache's configuration file: httpd.conf.

The Cheat
04-23-2004, 01:09 AM
wow... i never realised xhtml is such bleeding edge and mozilla/ff is like the only browser that supports it... :eek:

I think i'll be going back to html 4.01 strict until xhtml gets more support from the most common browsers.

thanks for that article :)

fredmv
04-23-2004, 01:15 AM
I think you slightly misunderstood the article. XHTML is supported by all browsers when sent as text/html, it's just browser support isn't as good when sent as application/xhtml+xml (i.e., an application of XML). You can, however, use server-side methods to ensure the client in question can handle XHTML served as an application of XML using the method described in the aforementioned article which would be quite safe.

The Cheat
04-23-2004, 01:20 AM
oh, ok i think i understand now...

So xhtml works just fine when sent as text/html, however, when you send as application/xhtml+xml is when you run into problems....

What's the advantage of using application/xhtml+xml over text/html anyways?

fredmv
04-23-2004, 01:24 AM
XHTML doesn't always work OK (or as intended) when sent as text/html and reasons for this can be found in Hixie's excellent article: Sending XHTML as text/html Considered Harmful (http://www.hixie.ch/advocacy/xhtml). Moreover, note that browsers in which support XHTML sent as an application of XML are primarily Mozilla and more recent versions of Opera. As for advantages, when sent as an application of XML you can then use XML applications along with it (e.g., MathML or SVG) and I also believe the page will render faster due to it being handled by an XML processor.

The Cheat
04-23-2004, 01:27 AM
k,

your link doesn't work...

thats better :p

The Cheat
04-23-2004, 01:35 AM
thanks for this.

I think i will still stick with html 4.01 for now.... Since sending as application/xhtml+xml only works in real browsers and sending as text/html is harmfull. + i dont like the idea of having to use a SSL to serve up a true xhtml page but still be functional in crappy browsers. Html 4.01 is just more convient for the time being- i think. :o

i have a better understanding of some stuff now, thanks for taking the time to explain stuff! :)

fredmv
04-23-2004, 01:40 AM
Not a problem and I think your choice is fine even more so if you're not planning on using other XML technologies alongside it. HTML 4.01 can be used to create perfectly semantic documents and you won't have to worry about MIME type problems and browser support.

The Cheat
04-23-2004, 01:45 AM
yup that's the reasoning behind my decision :)

hey another question. LOL!!! :D

should i stick this content-language meta tag inside of my html 4.01 strict pages?
<meta http-equiv="content-language" content="en">

I know that in xhtml you have to specify the language, should i do this as well for html 4.01? Would there be any benefit in doing this?

:D

fredmv
04-23-2004, 01:48 AM
It couldn't hurt to add it though I believe you could get away without it.