Skip to content

Instantly share code, notes, and snippets.

@nifl
Last active September 26, 2015 20:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nifl/1157774 to your computer and use it in GitHub Desktop.
Save nifl/1157774 to your computer and use it in GitHub Desktop.
JavaScript Notes

Javascript notes

JS is ...

  • Interpreted, not compiled
  • Case-sensitve
  • Whitespace insensitive except within quotes

Placement

  • If script is placed in the head, script executes before page is loaded.
  • If script is place in the body, page will load before script is executed.
  • Generally, script should be placed at the bottom of the body.
  • Avoid inline JS, place in separate .js files.
  • Scripts called w/ <script src="my_script.js" type="text/javascript">
  • 'type' required for validating HTML 4 Strict and XHTML, optional in HTML5.
  • 'type' can be considered optional and safely omitted from script tag.
@nifl
Copy link
Author

nifl commented Nov 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment