Responsive url shortening website (API, Sass, BEM)
Design comparison
Solution retrospective
This project was really challenging. It may not be perfect, but I tried my best. And it was my first time working with APIs. Therefore I could not figure out how to save shortened links list when the user refreshes the page.
Any feedback is highly appreciated.
Community feedback
- @nelsonleonePosted almost 2 years ago
**HELLO......congrats on completing the challenge, well done 🎊 🎊 **
Firstly, you solution looks nice , but see to reduce the header font size, and set a
max-width
to the intro-text area.#Straight to the point , based on your question. You can save the shortened link to localStorage and retrieve it when the user refreshes the page.
here's how
This is just one way to do it, hope you understand.
(saving just one shortened link) -You can create a
variable
, after the fetch...... assign it to the shortened link-.-Then use the
localStorage.setItem("key",....then the variable name)
--You must have already created a div(container) which will contain your shortened links-
-When the user refreshes/comes back, the
localStorage.getItem("key")
you will set , will get the value of the key stored in localStorage which is the variable.--Take that variable and use the DOM innerText .....innerHTML to display the value in the page.-
You can read more about
localStorage
in the w3docs, w3schools, and MDN docs Hope this comment made ....at least little meaning to youHave fun coding
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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