js.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Fri, 12 Nov 2010 22:05:45 +0200
changeset 693 14208482f30d
parent 586 0b065ce3d94c
child 695 2667994643de
permissions -rw-r--r--
Reduce js code size.

-*- outline -*-

* HTML.

<noscript> tag used to render HTML if JavaScript disabled in browser.

** Include in HTML.

  <html>
    <head>
      <script type="text/javascript" src="abc.js"></script>
    </head>
   ...
  <html>

** Inline in HTML.

  <html>
    <h1>Hello!<h1/>
    <script language="javascript">
      <!--
      alert("Hello!")
      document.write("sin(10) = " + Math.sin(10))
      //-->
    </script>
  </html>

* Hot calc by Firefox.

At URI type some thing like "javascript: 4+5"

* Reduce js code size.

  http://crockford.com/javascript/jsmin
                The JavaScript Minifier
  http://developer.yahoo.com/yui/compressor/
                YUI Compressor