title: JavaScript
category: page
slug: javascript
sort-order: 052
choice1url: /cascading-style-sheets.html
choice1icon: fa-css3 fa-inverse
choice1text: How do I style my web application's user interface?
choice2url: /static-content.html
choice2icon: fa-spinner fa-inverse
choice2text: Where should I host static content such as my JavaScript files?
choice3url: /source-control.html
choice3icon: fa-code-fork fa-inverse
choice3text: How do I save and version my code so it does not get lost?
choice4url: /application-programming-intefaces.html
choice4icon: fa-exchange
choice4text: What are web application programming interfaces?


# JavaScript
JavaScript is a small scripting programming language embedded in web browsers 
to enable dynamic content and interaction. 


## Why is JavaScript necessary?
JavaScript executes in the client and enables dynamic content and interaction
that is not possible with HTML and CSS alone. Every modern Python web 
application uses JavaScript on the front end. 


## Front end frameworks
Front end JavaScript frameworks move the rendering for most of a web 
application to the client side. Often these applications are informally 
referred to as "one page apps" because the webpage is not reloaded upon every
click to a new URL. Instead, partial HTML pages are loaded into the 
document object model or data is retrieved through an API call then displayed
on the existing page.

Examples of these front end frameworks include:

* [Angular.js](https://angularjs.org/)

* [Backbone.js](http://backbonejs.org/)

* [Ember.js](http://emberjs.com/)

Front end frameworks are rapidly evolving. Over the next several years 
consensus about good practices for using the frameworks will emerge.


## How did JavaScript originate?
JavaScript is an implementation of 
[the ECMAScript specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/JavaScript_Overview) 
which is defined by the 
[Ecma International Standards Body](http://www.ecma-international.org/default.htm).


## JavaScript resources
* [How Browsers Work](http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/)
  is a great overview of both JavaScript and CSS as well as how pages are 
  rendered in a browser.

* [A re-introduction to JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript)
  by Mozilla walks through the basic syntax and operators.

* [Coding tools and JavaScript libraries](http://www.smashingmagazine.com/2011/10/28/useful-coding-workflow-tools-for-web-designers-developers/)
  is a huge list by Smashing Magazine with explanations for each tool and 
  library for working with JavaScript.

* [Superhero.js](http://superherojs.com/) is an incredibly well designed list
  of resources for how to test, organize, understand and generally work with
  JavaScript.

* [Unheap](http://www.unheap.com/) is an amazing collection of reusable JQuery 
  plugins for everything from navigation to displaying media.

* [The State of JavaScript in 2015](http://www.breck-mckye.com/blog/2014/12/the-state-of-javascript-in-2015/)
  is an opinion piece about favoring small, single-purpose JavaScript libraries 
  over larger frameworks due to churn in the ecosystem.


## JavaScript learning checklist
<i class="fa fa-check-square-o"></i> 
Create a simple HTML file with basic elements in it. Use the
``python -m SimpleHTTPServer`` command to serve it up. Create a 
``<script type="text/javascript"></script>`` 
element at the end of the ``<body>`` section in the HTML page. Start playing 
with JavaScript within that element to learn the basic syntax.

<i class="fa fa-check-square-o"></i> 
Download [JQuery](http://jquery.com/) and add it to the page above your 
JavaScript element. Start working with JQuery and learning how it makes basic
JavaScript easier.

<i class="fa fa-check-square-o"></i> 
Work with JavaScript on the page. Incorporate examples from open source 
projects listed below as well as JQuery plugins. Check out the Unheap link
below to find a large collection of categorized JQuery plugins.

<i class="fa fa-check-square-o"></i> 
Check out the JavaScript resources below to learn more about advanced concepts
and open source libraries.

<i class="fa fa-check-square-o"></i> 
Integrate JavaScript into your web application and check the 
[static content](/static-content.html) section for how to host the JavaScript
files.


### Do you need to style your app or deploy it next?
