🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 4 Min Lesezeit
0

Bookmarker

↗ Quelle (dev.to)
🗣️ Stimme:

Building a Bookmark Management System: Practicing JavaScript and Local Storage



As I continue my front-end development journey, I realized the need to practice advanced JavaScript concepts and create functional projects to solidify my skills. To do so, I built a Bookmark Management System using HTML, CSS, Bootstrap, and JavaScript. The project leverages Local Storage for data persistence and includes features such as adding, updating, deleting, and searching bookmarks.



This project not only helped me improve my JavaScript skills but also gave me insights into creating user-friendly interfaces and managing client-side data effectively.






Features of the Bookmark Management System




  1. Add Bookmarks: Save bookmarks with a name and URL.


  2. Search Bookmarks: Quickly find bookmarks by name.


  3. Update Bookmarks: Edit existing bookmark details.


  4. Delete Bookmarks: Remove bookmarks permanently.


  5. Data Persistence: Bookmarks are stored in the browser's Local Storage, ensuring they remain available even after the page is refreshed.


  6. Validation: Input validation ensures that only valid bookmark names and URLs are accepted.







Key JavaScript Snippets and Concepts




  1. Saving Bookmarks to Local Storage




CODE
let bookmarksContainer = [];
if (localStorage.getItem('book')) {
bookmarksContainer = JSON.parse(localStorage.getItem('book'));
display();
}

addbtn.addEventListener('click', function() {
if (bookName.classList.contains('is-valid') && bookUrl.classList.contains('is-valid')) {
let bookmark = {
name: bookName.value,
url: bookUrl.value
};
bookmarksContainer.push(bookmark);
localStorage.setItem('book', JSON.stringify(bookmarksContainer));
clearInput();
display();
} else {
errorBox.classList.remove('d-none');
}
});






This code initializes the bookmark container and ensures that bookmarks saved in Local Storage are loaded when the page is refreshed.




  1. Displaying Bookmarks




CODE
function display() {
let row = '';
for (let i = 0; i < bookmarksContainer.length; i++) {
let httpURL = 'https://' + bookmarksContainer[i].url;
row += `
<tr>
<td>${i + 1}</td>
<td>${bookmarksContainer[i].name}</td>
<td><a href="${httpURL}" class="btn btn-success">Visit</a></td>
<td><button onclick="deleteItem(${i})" class="btn btn-danger">Delete</button></td>
<td><button onclick="setFormForUpdate(${i})" class="btn btn-warning">Update</button></td>
</tr>
`;
}
document.getElementById('tableOfContent').innerHTML = row;
}






The display function dynamically renders the bookmarks in a table, making it easy for users to manage their saved links.




  1. Deleting Bookmarks




CODE
function deleteItem(index) {
bookmarksContainer.splice(index, 1);
display();
localStorage.setItem('book', JSON.stringify(bookmarksContainer));
}






This function removes the selected bookmark and updates Local Storage to ensure data consistency.




  1. Input Validation



function




CODE
validateInput(element) {
const regex = {
bookmarkName: /^([A-Z]|[a-z]|[0-9]){3,}$/,
URL: /^(https?:\/\/)?(w{3}\.)?\w+\.\w{2,}\/?(:\d{2,5})?(\/\w+)*$/
};
if (regex[element.id].test(element.value)) {
element.classList.add('is-valid');
element.classList.remove('is-invalid');
return true;
} else {
element.classList.add('is-invalid');
element.classList.remove('is-valid');
return false;
}
}







This validation ensures that users enter meaningful names and properly formatted URLs.




  1. Updating Bookmarks




CODE
function setFormForUpdate(i) {
updatedIndex = i;
addbtn.classList.add('d-none');
updatebtn.classList.remove('d-none');
bookName.value = bookmarksContainer[i].name;
bookUrl.value = bookmarksContainer[i].url;
}

function update() {
bookmarksContainer[updatedIndex].name = bookName.value;
bookmarksContainer[updatedIndex].url = bookUrl.value;
display();
localStorage.setItem('book', JSON.stringify(bookmarksContainer));
clearInput();
addbtn.classList.remove('d-none');
updatebtn.classList.add('d-none');
}






The update functionality lets users modify existing bookmarks and save the changes seamlessly.






Lessons Learned




  1. Data Management: Storing and retrieving data from Local Storage taught me the importance of client-side storage.


  2. Dynamic DOM Manipulation: Creating, updating, and deleting DOM elements dynamically improved my JavaScript skills.


  3. Input Validation: Ensuring only valid inputs are accepted made the application more robust.


  4. User Experience: Adding error handling and form validation improved the overall usability of the project.







Future Enhancements



Implement category-based organization for bookmarks.



Add drag-and-drop functionality for sorting bookmarks.



Use external APIs to fetch website metadata for better bookmark previews.






This project was a fun and challenging way to deepen my understanding of JavaScript and enhance my skills in building interactive, user-focused web applications. If you're on a similar journey, I encourage you to build and experiment with projects like this to grow your skills.

Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Bookmarker

Thematisch verwandte Begriffe: Bookmarker · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...