Web Developer Notes - Page 2
Working with Cookies in JavaScript
Last updated: 09.02.2026
Views: 137
Сookie (web cookie or browser cookie) is a string of information that can be stored in a browser and sent to the server.
The maximum size for one cookie is 4096 bytes. The number of cookies for one domain can be from 20 to 242, depending on the browser.
Cookies are written as a string, but on a key-to-value basis.
[js]document.cookie = "username=John Brown";[/js]
Cookies may contai...
Finding the Distance Between Two Points on a Map Using JavaScript (TypeScript)
Last updated: 04.01.2026
Views: 257
If you have the coordinates of two points on a map, calculating the distance between them is a fairly straightforward task. This type of calculation is commonly used in mapping applications, delivery services, navigation systems, and location-based features. In this example, we will focus on determining the distance using geographic coordinates such as latitude and longitude. These values allow us...
Converting an Image to Base64 Using JavaScript
Last updated: 06.12.2025
Views: 208
Converting an image to a Base64 string in JavaScript can be extremely useful in many modern web development scenarios. One of the most common reasons for using Base64 is to send image data through an API, where binary files might not be accepted directly. Base64 is also convenient when you want to display a preview of an uploaded image before sending it to the server. Instead of uploading the file...
How to Run (Deploy) a Single Page Application (SPA) on Shared Hosting
Last updated: 06.11.2025
Views: 281
Building modern websites with Vue or React has become the standard practice in web development. However, when you try to deploy a Single Page Application (SPA) to a regular shared hosting environment, you may encounter a common issue — only the home page loads correctly, while all internal routes (pages) return a 404 error. This happens because the hosting server doesn’t understand client-side rou...
Vue Accordion Component
Last updated: 13.03.2026
Views: 604
A simple and lightweight Vue 3 accordion component plugin. Supports both global plugin registration and local component usage. Written in TypeScript. The accordion component contains a minimum of CSS styles, which makes it easy to integrate into any of your designs. You can install the component using the NPM or Yarn package managers. The component allows you to configure the ability to have one o...