Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

URL shortening site With HTML5/SCSS VANILLA JAVSCRIPT AND API

#bem#sass/scss#fetch
Nneoma Njoku 1,210

@SatellitePeace

Desktop design screenshot for the URL shortening API landing page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
3intermediate
View challenge

Design comparison


SolutionDesign

Solution retrospective


I could not get the URL stored in the local storage to load I kept getting errors

Any advice of how to solve this problem will be greatly welcome

  • Also I think my Javascript code is very disorganized and a bit difficult to read

  • I will appreciate tips for refactoring and best practices for writing clean Javascript code

  • Lastly, i added a delete button in form of an icon so the user can delete a url without having to refresh the page

Community feedback

Josh 560

@jkellerman

Posted

I've had a quick look and checked the applications tab in chrome dev tools. The links are saving but not loading.

I would do something along the lines of:

  • create a function that loads the todos.

E.g function loadTodos() {

const todos = localStorage.getItem(todos);

return JSON.parse(todosString) || [ ]; }

  • create function that saves the todos

E.g function saveTodos() {

localStorage.setItem(todos, JSON.stringify(todos)); }

The loadTodos() function should run every time the page loads and saveTodos() should run whenever the user shortens a url.

Hope this helps! Happy coding

Marked as helpful

0

Nneoma Njoku 1,210

@SatellitePeace

Posted

Thanks, @jkellerman i will definitely try this

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord