Is there a useful purpose for <style type="text/javascript">?
What is the use 开发者_JS百科and purpose this , is it useful?
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.
i believe its bug. "text/javascript shall be associated only with script tag not style tag!
Both <style></style>
and <script></script>
can be used without any 'type' attribute. Probably a sticky web tradition.
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/
Style type can not be "text/javascript". It should be only "text/css".
精彩评论