Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
JavaScript Style Sheets
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Stylesheet language proposed by Netscape}} {{More citations needed|date=November 2023}} {{infobox file format | name = JavaScript Style Sheets | extension = | screenshot = | mime = text/javascript | owner = [[Netscape|Netscape Communications Corporation]] | genre = [[Style sheet language]] | standard = [http://www.w3.org/Submission/1996/1/WD-jsss-960822 Netscape's JavaScript-Based Style Sheets submission to the W3C] }} '''JavaScript Style Sheets''' ('''JSSS''') was a [[stylesheet language]] technology proposed by [[Netscape|Netscape Communications]] in 1996 to provide facilities for defining the presentation of [[webpages]].<ref name="chapter20">{{cite web|title=Chapter 20 - The CSS saga|url=http://www.w3.org/Style/LieBos2e/history/|publisher=[[World Wide Web Consortium]]|access-date=23 June 2010|author=Håkon Wium Lie|author-link=Håkon Wium Lie|author2=Bert Bos|author2-link=Bert Bos}}</ref> It was an alternative to the [[Cascading Style Sheets]] (CSS) technology.<ref name="chapter20" /> Although Netscape submitted it to the [[World Wide Web Consortium]] (W3C), the technology was never accepted as a formal standard and it never gained acceptance in the [[web browser]] market. Only [[Netscape Communicator]] 4 implemented JSSS, with rival [[Internet Explorer]] choosing not to implement the technology. Soon after Netscape Communicator's release in 1997, Netscape stopped promoting JSSS, instead focusing on the rival CSS standard, which was also supported by Internet Explorer and had a much wider industry acceptance. The follow-up to Netscape Communicator, [[Netscape 6]] (released in 2000), dropped support for JSSS. It now remains little more than a historical footnote, with [[Web development|web developers]] generally unaware of its previous existence. The proposal did not become a W3C standard. == Syntax == Using [[JavaScript]] code as a stylesheet, JSSS styles individual element by modifying properties of a <code>document.tags</code> object. For example, the CSS: <syntaxhighlight lang="css"> h1 { font-size: 20pt; } </syntaxhighlight> is equivalent to the JSSS: <syntaxhighlight lang="javascript"> document.tags.H1.fontSize = "20pt"; </syntaxhighlight> JSSS element names are case sensitive. JSSS lacks the various CSS selector features, supporting only simple tag name, class and id selectors. On the other hand, since it is written using a complete [[programming language]], stylesheets can include highly complex dynamic calculations and conditional processing. (In practice, however, this can be achieved using [[JavaScript]] to modify the stylesheets applicable to the document at runtime.) Because of this JSSS was often used in the creation of [[dynamic web page]]s. ===Example=== The following example shows part of the source code of an HTML document: <syntaxhighlight lang="html"> <style type="text/javascript"> tags.H1.color = "red"; tags.p.fontSize = "20pt"; with (tags.H3) { color = "green"; } with (tags.H2) { color = "red"; fontSize = "16pt"; marginTop = "4cm"; } </style> </syntaxhighlight> Similar to [[Cascading Style Sheets]], JSSS could be used in a {{tag|style|o}} tag. This example shows two different methods to select tags. ==Browser support== Javascript Style Sheets were only supported by Netscape 4.x (4.0–4.8) but no later versions. No other [[web browser]] has ever implemented JSSS. ==References== {{Reflist}} ==External links== *[http://www.w3.org/Submission/1996/1/WD-jsss-960822 Netscape's JavaScript-Based Style Sheets submission to the W3C] *[http://sunsite.uakom.sk/sunworldonline/swol-04-1997/swol-04-webmaster.html The dynamic, powerful abilities of JavaScript Style Sheets] *[https://web.archive.org/web/20200401000000*/http://www.damsbo.com/webdev/jsss/jss25.htm JavaScript Style Sheet Reference] {{ECMAScript}} {{Netscape}} {{Stylesheet languages}} {{W3C standards}} [[Category:JavaScript|Style Sheets]] [[Category:Stylesheet languages]] [[Category:Netscape]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite web
(
edit
)
Template:ECMAScript
(
edit
)
Template:Infobox file format
(
edit
)
Template:More citations needed
(
edit
)
Template:Netscape
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Stylesheet languages
(
edit
)
Template:Tag
(
edit
)
Template:W3C standards
(
edit
)