Lab 02: jQuery and the DOM

Content

  1. Submission Instructions
  2. Resources
  3. Configuration
  4. User Stories and Feature Tasks

--

Submission Instructions

Follow the submission instructions outlined in our submit-process repo.

Resources

jQuery cheatsheet

Configuration

Your repository must include:

02-jquery-and-the-dom
├── .eslintrc.json
├── .gitignore
├── LICENSE
├── README.md
├── index.html
├── scripts
│   ├── article.js
│   └── blogArticles.js
├── styles
│   ├── base.css
│   ├── fonts
│   │   ├── icomoon.eot
│   │   ├── icomoon.svg
│   │   ├── icomoon.ttf
│   │   └── icomoon.woff
│   ├── icons.css
│   ├── layout.css
│   └── modules.css
└── vendor
    └── styles
        └── normalize.css

User Stories and Feature Tasks

  • Continue styling the app using SMACSS practices. Take a few minutes for code review of your partner's CSS from yesterday and decide how to incorporate it into your paired lab. You can choose one partner's CSS structure, or you can combine them as you see fit. Seek to optimize and organize your CSS as much as possible!

As a user, I want my site to display my blog articles in a clear, logical way so that I can find the most recent articles first and the blog is easy to read.

  • Complete the toHtml() method, which will ultimately be used to render each article instance to the DOM.
  • The articles should be sorted by date.

As a developer, I want to make my code DRY and render articles from a separate data file so that my HTML file is not cluttered with lengthy and repetitive code.

  • Complete the Article() constructor and create instances by assigning all of the properties of each data object to properties of this.

As a developer, I want to utilize the jQuery library's functionality so that I can efficiently access, traverse, and manipulate elements on the DOM.

  • Add the necessary script tag to include jQuery in the app.
  • Utilize jQuery functionality to modify the display property of DOM elements.
  • Utilize jQuery functionality to traverse the DOM and complete the HTML template for the articles.

As a developer, I want to optimize iteration with JavaScript array methods so that my code is more condensed and maintainable.

  • Refactor all for loops using the .forEach() method.