Categorized | Web 2.0

Squeeze CSS and JS into one file

If you wanted a hack to allow you to put JavaScript and CSS into the same file you got it:
HTML:
  1. <!-- /*
  2. function t(){}
  3. <!-- */
  4. <!-- body { background-color: Aqua; }
You could of course just use JavaScript and add CSS programatically, but then you need to deal with browser quirks, and JavaScript has to be on and such. I would love to see any stats on why you would want to do this :)

Leave a reply

  1. You will post the following soon.
    Go ahead and start typing.