Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
January 14, 2022 05:34 pm GMT

JavaScript Project

I finished my phase 4 project for Flatiron School! I created a single-page web application for my JavaScript project.

I created 2 separate repos for the front end and back end. The back end was fairly similar to the phase 3 Rails project, with controllers, models, and has_many relationships.

My project was a book review/tracker, where a user can input a title, author, description, and category/genre. A category has_many books and a book belongs_to a category.

While it was interesting to create a mini Rails project and review some old material, I was most interested in the front end JavaScript portion and refining what I learned in phase 4. I utilized the fetch method to get the book data to display on the page, display new posts, and to delete posts.

The back end part of the project required creating a Rails API, which was interesting as the phase 3 Rails project did not incorporate this. The front end JavaScript portion of this project communicates with the API for the front end and back end to work together.

In JavaScript, event listeners are used to create actions. For example, my project has an attachDeleteButtonListener, which lets the server know that when the delete button is clicked, that book entry should be removed from the page. There is also another event listener that lets the page know to create a new book when "submit" is clicked on the new book form.

Overall, the JavaScript project was a great fusion of Rails and JavaScript that allowed me to synthesize my JavaScript knowledge and create a fun single-page web application.

Original Link:

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To