Code Monkey home page Code Monkey logo

aux-prework-h2013's Introduction

AUX H2013: JavaScript Primer

By now, you all have received a copy of Tim Wright's "Learning JavaScript". This book contains all the guidance you need to complete the following assignment. For each "sprint", create a new branch in git with a descriptive name (e.g. "add-jQuery"), and merge the code into the master branch when it is fully functional. If none of this makes any sense to you, check this out: http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

To deploy your code, create and push a branch called "gh-pages". This will automatically create a page that can be accessed at http://[your user name].github.com/[project name]. To update your gh-pages branch to your latest code, just merge in your master branch.

Sprint 1: Just make the damn thing work

Build a web form that instantly (i.e. without pressing "submit") searches a custom address book and returns all matches. You will need to create the address book data from scratch.

Required functionality:

  • After the first keypress, all matching search results must be visible
  • Modifying the search string should instantly update the results
  • Each search result should be the address book entry's name
  • Clicking on each search result should fire a mailto: link to send an email to that person
  • Must incorporate ARIA attributes for accessibility

Limitations:

  • No jQuery; raw JavaScript only
  • The address book data must be stored in JSON format inside your script
  • NO GLOBAL VARIABLES. Don't pollute the global namespace!

Sprint 2: Breaking up with a model

JavaScript data models like the address book don't really belong inside your application code. Take the JSON from Sprint 1 and split it out into its own contacts.json file. Use Ajax calls to pull in the necessary data. Your tool should function exactly as before.

Note: This won't work locally without running a local server. If you're on a Mac, you're in luck: just open up your terminal, navigate to the project folder, and type "python -m SimpleHTTPServer". It should respond with something like "Serving HTTP on 0.0.0.0 port 8000 ..."; in this case, you would point your browser to http://0.0.0.0:8000 to pull up the page. If you're on Windows, you can try your luck with WAMP, but I'm afraid Google is likely to be your best friend in this case.

Limitations:

  • No jQuery; raw JavaScript only
  • The address book data must be stored in an external JSON file
  • NO GLOBAL VARIABLES. Don't pollute the global namespace! (This should go without saying at this point)

Sprint 3: Holla for a $

Load in the jQuery library and "refactor" (i.e. reorganize & simplify) your code from Sprint 2 to incorporate space-saving selection, event attachment and utility functions from jQuery. Again, your tool should function exactly as before.

Note: After you see how easy Ajax is with jQuery, you will DESPISE us for making you build it first in raw JS. You'll get over it.

Keep an eye out for where you can use:

Sprint 4: Plug it in, plug it in

Your search tool is getting pretty sweet. Instead of keeping it all to yourself, why don't you turn it into a shareable plugin?

Required functionality:

  • Plugin must accept any path to an external JSON file (assume proper file formatting) as an option
  • Plugin must accept a string identifying the desired output element as an option; e.g. if you want to output to a div with ID "output", you should be able to set the output option to "#output" and have it work properly

Sprint 5: Mustachio bashio (EXTRA CREDIT)

Use the mustache.js library (https://github.com/janl/mustache.js/) to eliminate all HTML tags from your JavaScript code and put them in your HTML document where they belong.

During this sprint, feel free to add any styling or extra prettiness to your app. Just don't break the functionality!

aux-prework-h2013's People

Contributors

didgeoridoo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.