Close menu

JavaScript Style Sheets


Source: http://en.wikipedia.org/wiki/JavaScript_Style_Sheets
Updated: 2017-05-19T16:33Z
JavaScript Style Sheets
Filename extension.js
Internet media typetext/javascript
Developed byNetscape Communications Corporation
Type of formatStyle sheet language
StandardNetscape's JavaScript-Based Style Sheets submission to the W3C

JavaScript Style Sheets (JSSS) was a stylesheet language technology proposed by Netscape Communications Corporation in 1996 to provide facilities for defining the presentation of webpages.[1] It was an alternative to the Cascading Style Sheets (CSS) technology.[1] Although Netscape submitted it to the World Wide Web Consortium (W3C), the technology was never accepted as a formal standard and it never gained much acceptance in the market. Only Netscape Communicator 4 supported JSSS, with the rival Internet Explorer web browser 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 many Web developers not even being aware of its existence. The proposed standard was not finished.

Using JavaScript code as a stylesheet, JSSS styles individual element by modifying properties of the document.tags object. For example, the CSS:

 h1 { font-size: 20pt; }

is equivalent to the JSSS:

 document.tags.H1.fontSize = "20pt";

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 as Dynamic CSS by using JavaScript to modify the stylesheets applicable to the document at runtime.) Because of this JSSS was often used in the creation of DHTML.

Being written in JavaScript, JSSS may seem less friendly than CSS to users without a programming background.

Example

The following example shows part of the sourcecode of an HTML-document:

Invalid language.

You need to specify a language like this: <source lang="html4strict">...</source>

Supported languages for syntax highlighting:

4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, aimms, algol68, apache, applescript, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, caddcl, cadlisp, cfdg, cfm, chaiscript, chapel, cil, clojure, cmake, cobol, coffeescript, cpp, csharp, css, cuesheet, d, dart, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, ezt, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, ispfpanel, j, java, java5, javascript, jcl, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nginx, nimrod, nsis, oberon2, objc, objeck, ocaml, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, pic16, pike, pixelbender, pli, plsql, postgresql, postscript, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, qml, racket, rails, rbs, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, rust, sas, scala, scheme, scilab, scl, sdlbasic, smalltalk, smarty, spark, sparql, sql, standardml, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vbscript, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xpp, yaml, z80, zxbasic


<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>

Similar to Cascading Style Sheets, JSSS can be used in a <style>-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 integrated JSSS.

References

External links

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.

Also On Wow

    Advertisement

    Trending Now