Hello there!

General Kenobi, you are a bold one!




jQuery Pagination

November 3rd, 2019

General Overview:

The way my website used to work was that, if you wanted to access the site's Blog. The first five entries of all time would appear and with a Pagination you could use that to acess more entries. If I wanted Entry 23, I would have to go to Blog.html, and access the Pagination, click the 3rd option and access an entirely different .html file called Blog03.html While genius at first, or so I thought because I was able to access more entries "effectively". A colleague suggested "merging" all the Blog.htmls (Blog.html, Blog02.html, Blog03.html etc) into one super Blog.html that'll keep all the entries under one page. I thought that wouldn't be necessarily user-friendly (though I admittely, I know practically nothing of UX) but then the colleague suggested to build a function that'd show different entries when clicking the Pagination. Showing different entries and replacing existing which saves loading different files and brings it all under one roof.

It was genius I thought, a function that could show a select set of entries at a time, and be able to replace that set to accomplish the same goal with the Pagination. Just without having to load different .html files. So using an already existing function from Entry 16, that filter Entries by basically hiding and showing. I replicated that and adjusted it accordingly to fit it's new purpose.

The way it works is that, every Entry now has a class. Some entries belong under Set 2, others Set 3 and so on. So with the below code, it'd hide every set but one.


Q1.