Is there a useful purpose for <style type="text/javascript">?
Asked Answered
H

5

6

What is the use and purpose this , is it useful?

Hudgens answered 24/1, 2010 at 17:6 Comment(0)
E
12

It's for "JSSS", or Javascript style sheets; see here for more info. It's nonstandard and never really caught on outside of Netscape's original proposal, which you can read here. I don't think most browsers today support this; I've certainly never seen a website that used it.

Eichmann answered 24/1, 2010 at 17:11 Comment(5)
In fact, only supported in NS4.Longevous
Good lord, that’s right. I’d completely forgotten about that odd little branch of web development history. Just think, if that had caught on, jQuery might never need to have been written.Bushhammer
What, JSSS gives you the $() function?Gazpacho
it's strange if it's so old and outdated then why still dreamweaver has supportHudgens
@Jitendra » I guess that's the million-dollar question, isn't it? :)Eichmann
F
0

i believe its bug. "text/javascript shall be associated only with script tag not style tag!

Frants answered 24/1, 2010 at 17:10 Comment(0)
K
0

Both <style></style> and <script></script> can be used without any 'type' attribute. Probably a sticky web tradition.

Kalmuck answered 24/1, 2010 at 17:41 Comment(1)
Good idea to always include them, though, since they're required in strict doctypes.Cacus
T
0

Most importantly, all browsers besides NS4 will ignore the block of code, when the type is unrecognized. Perhaps not important for the Style tag, but useful for the Script tag..

See more about templating with this at http://ejohn.org/blog/javascript-micro-templating/

Thou answered 24/1, 2010 at 18:2 Comment(0)
L
0

Style type can not be "text/javascript". It should be only "text/css".

Laritalariviere answered 25/1, 2010 at 7:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.