Monday November 16

Daily JS

DOM Manipulation

Pagination is common on news sites, e-commerce, and blogs. Write a function that prints out the pagination text. It should take in three arguments for pageNumber, pageSize, and totalProducts. Then it will output something like Showing 1 to 10 of 30 Products..

function paginationText(pageNumber, pageSize, totalProducts) {

}


console.assert(paginationText(1, 10, 30) === 'Showing 1 to 10 of 30 Products.')
console.assert(paginationText(3, 10, 26) === 'Showing 21 to 26 of 26 Products.')
console.assert(paginationText(1, 10,  8) === 'Showing 1 to 8 of 8 Products.')

Review

Looking through the "Adventures in the DOM" exercise:

Assignment

Today there are a few things I want you to do:

This should be mostly review with a sprinkling of new topics. On each page, there is a I really want you to focus on the AJAX part since we will be covering the topic of AJAX and data for the rest of the week.

NOTE when looking at the click, mousedown, etc: it is better practice to use on('click') or on('mousedown'), etc.

This is an opportunity to take time and learn from each other. This will also give time to realize there are somethings that you know and can REALLY learn by helping to explain to each other. I will be available all day via slack or phone, give me a call when questions come up. I recommend plugging in one computer and working from the front so you can work together as one group. I also recommend try to do the part you are most uncomfortable with and contribute that, take it as a chance to level up!

Level Up

Teamwork

For lab time, work together in the following groups to try and to clean some things up on old assignments. There is a common idea called "Code Review" where team members will work together to make projects better. Work together to bring some assignments up to date and fill in some gaps.

  • Brandi and Brian
  • Jeremy, Chancey, and David