560 blogs tracked7,114 posts indexed

#javascript

25 posts · 12 companies · newest first

Curated view of this subject:Topic: JavaScript59
1

Taking Request Cancellation Beyond the Browser (opens on the source site)

Imagine opening a dashboard that generates a fairly detailed analytics report. You click a button, the application starts fetching data from a couple of APIs, and then you realise you don’t need the report anymore. So, you close the tab and move on. From your (user’s) perspective, the operation is over. But on the server, things might be very different. It could still be making API calls, running database queries, or an expensive operation such as waiting for an AI model to generate a response. All of that work might continue even though there’s nobody waiting for the result anymore. This is…

javascriptexcerpt only · body stays at the source
From the web
2

JavaScript Gets a New Set of HTML Insertion APIs (opens on the source site)

There are several ways to insert HTML into a web page using JavaScript. You can use innerHTML, insertAdjacentHTML(), createContextualFragment(), or even the relatively newer setHTML() method. They all get the job done, but they don’t necessarily behave in the same way. Some replace existing content, some append it, and some provide built-in HTML sanitization. If you want to stream HTML into an element, things get a little more complicated. Chrome (and Edge) is trying to bring some consistency to this with a new set of HTML insertion and streaming methods. These methods provide a more…

javascriptexcerpt only · body stays at the source
From the web
6

Four months of VoidZero at Cloudflare: making the open-source JavaScript toolchain faster for all humans and agents (opens on the source site)

Since joining Cloudflare, VoidZero has delivered more than 80 releases that drastically speed up JavaScript compilation, linting, and testing. From a 10x faster React compiler to Vite+ 1.0, here’s how we are building faster tools for developers and AI agents.

birthday-weekdevelopersexcerpt only · body stays at the source
From the web
9

Partnerships can keep open source sustainable (opens on the source site)

Ryan welcomes VoidZero’s Evan You and Cloudflare’s Dane Knecht back to the show to discuss Cloudflare’s recent acquisition of VoidZero and what it means for JavaScript development, how partnerships like theirs can help open-source projects stay maintained and sustainably monetized, and how Cloudflare’s distributed systems are helping to improve developer experience in Vite and beyond.

podcastse-techexcerpt only · body stays at the source
From the web
10

How we built the new Table of Contents feature (opens on the source site)

How a feature goes from idea to prototype to shippedFor years, there’s been this really popular Chrome extension for adding a table of contents to your Medium stories. Props to Vinicius De Antoni for writing a popular chrome extension all those years go.The extension was so popular, we even wrote about it in our Medium Handbook.How to make a table of contents for your Medium storyThe fact that it was so popular was a signal to me. There was a decent size of our user base that wanted this feature. So, at first I set out to just copy it.The Chrome extension extends the popup menu we have in the…

programmingsoftware-engineeringexcerpt only · body stays at the source
From the web
11

On programming languages, targets, and platforms (opens on the source site)

I started as a Java developer, but for some time now, I have broadened my horizons. Recently, I thought about how early languages were dedicated to a single target and platform, and now they are broadening their focus. In this post, I want to write down my thoughts in the hope that it may be useful to others, probably to my future self. Definitions You may have been wondering about the title terms.

javakotlinexcerpt only · body stays at the source
From the web
12

How we improved image download sizes on Medium with just four characters (opens on the source site)

HTML images just got better, with the subtlest change to your codebasePhoto by Adi SuyatnoI know what you’re thinking.Scott, I landed on Medium on a small but not mobile-small display and the download chunk related to images in my home feed was like 7% smaller.First of all, thank you for noticing.Second, what if I told you that you too can improve your total asset download size by adding just four characters to your code base?Sounds too good to be true, right? Well, I’m here to tell you, it’s true… after I explain how we got here.The history of images on the webAs a web developer, you’ve…

htmljavascriptexcerpt only · body stays at the source
From the web
13

Making Our Frontend Unit Tests Much Faster with @swc/jest (opens on the source site)

We were annoyed with the slow performance of our frontend unit tests, so we made them much faster! It turned out that swapping out the test runner is an easy and efficient way to keep the migration effort low, while reaping the benefits of much faster execution times.

frontendjavascriptexcerpt only · body stays at the source
From the web
14

JavaScript SpeechSynthesis API (opens on the source site)

As the web continues to be the medium for all users, standards bodies need to continue to provide new APIs to enrich user experience and accessibility. One underused API for unsighted users is speechSynthesis, an API to programmatically direct the browser to audibly speak any arbitrary string. The Code You can direct the browser to utter speech with window.speechSynthesis and SpeechSynthesisUtterance: window.speechSynthesis.speak( new SpeechSynthesisUtterance('Hey Jude!') ) speechSynthesis.speak will robotically tell the user anything you provide as a SpeechSynthesisUtterance string. Support…

javascriptexcerpt only · body stays at the source
From the web
15

OTP Authentication in Laravel & Vue.js for Secure Transactions (opens on the source site)

Introduction In today’s digital world, security is paramount, especially when dealing with sensitive data like user authentication and financial transactions. One of the most effective ways to enhance security is by implementing One-Time Password (OTP) authentication. This article explores how to implement OTP authentication in a Laravel backend with

javascriptsecurityexcerpt only · body stays at the source
From the web
18

Detect Caps Lock with JavaScript (opens on the source site)

Anyone is capable of having their caps lock key on at any given time without realizing so. Users can easily spot unwanted caps lock when typing in most inputs, but when using a password input, the problem isn’t so obvious. That leads to the user’s password being incorrect, which is an annoyance. Ideally developers could let the user know their caps lock key is activated. To detect if a user has their keyboard’s caps lock turn on, we’ll employ KeyboardEvent‘s getModifierState method: document.querySelector('input[type=password]').addEventListener('keyup', function (keyboardEvent) { const…

javascriptexcerpt only · body stays at the source
From the web
19

Date.now() (opens on the source site)

Ask any software engineer and they’ll tell you that coding date logic can be a nightmare. Developers need to consider timezones, weird date defaults, and platform-specific date formats. The easiest way to work with dates is to reduce the date to the most simple format possible — usually a timestamp. To get the immediate time in integer format, you can use Date.now: const now = Date.now(); // 1705190738870 I will oftentimes employ Date.now() in my console.log statements to differentiate likewise console.log results from each other. You could also use that date as a unique identifier for an…

javascriptquick-tipsexcerpt only · body stays at the source
From the web
20

Extract a Number from a String with JavaScript (opens on the source site)

User input from HTML form fields is generally provided to JavaScript as a string. We’ve lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let’s rely on regular expressions to extract those numbers! To employ a regular expression to get a number within a string, we can use \d+: const string = "x12345david"; const [match] = string.match(/(\d+)/); match; // 12345 Regular expressions are capable of really powerful operations within JavaScript; this practice is one of the easier operations.…

javascriptquick-tipsexcerpt only · body stays at the source
From the web
21

Accept E-Commerce Payments Easily with PayPal’s Buttons Component (opens on the source site)

Accepting online payments is now a universal must-have, catering to everyone from solo entrepreneurs to massive global corporations.PayPal’s Standard Checkout allows for seamless integration of PayPal’s Payment Buttons component into your e-commerce app, granting you the power to accept online payments. In this guide, I am going to show how to add Standard Checkout to a simple shopping app, built with HTML and NodeJS.Guide OverviewPart 1. PrerequisitesPart 2a. Basic Integration — Code SetupPart 2b. Basic Integration — Checkout FlowPart 3a. Custom Integration — Code SetupPart 3b. Custom…

programmingpayments-technologyexcerpt only · body stays at the source
From the web
23

Proxy in JavaScript (opens on the source site)

As we can already guess from the name, a Proxy object works as a “proxy” to another object and allows us to customize the behavior of the said object in certain ways. Let’s say you have an obj named awesomeAPI which has some properties and methods. You want to “trap” any calls to the object. May […] The post Proxy in JavaScript appeared first on Abu Ashraf Masnun.

javascriptexcerpt only · body stays at the source
From the web
24

Promises in JavaScript (opens on the source site)

We encounter promises in real life every now and then. You have promised to deliver that project within the next week. Your friend has promised to play Overwatch with you tonight. If you think about it, promises are everywhere around us. Promises in JavaScript also play similar roles. A Promise object in JS is an […] The post Promises in JavaScript appeared first on Abu Ashraf Masnun.

javascriptexcerpt only · body stays at the source
From the web
25

REST API with KoaJS and MongoDB (Part – 3) (opens on the source site)

In Part -1 of this series, we saw how we can get started with KoaJS and in Part – 2 we built CRUD endpoints with MongoDB. In this part, we’re going to work with authentication. We will be using JSON Web Tokens aka JWT for the auth part. We have written detailed pieces on JWT before. You […] The post REST API with KoaJS and MongoDB (Part – 3) appeared first on Abu Ashraf Masnun.

javascriptjwtexcerpt only · body stays at the source
From the web
25 shown

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.