How to Design Digital Clock using JavaScript ?
Clocks are useful elements for any UI if used in a proper way. Clocks can be used on sites where time is the main concern like some booking sites or some app showing arriving times of trains, buses, flights, etc. The clock is basically of two types, Analog and Digital. We will be looking at making a digital one....
read more
Why we use then() method in JavaScript ?
The then() method is a key feature of JavaScript’s Promise API, designed specifically to handle asynchronous tasks like API calls. In the past, callback functions were commonly used for such tasks, leading to code that was difficult to maintain....
read more
How to include a JavaScript file in another JavaScript file ?
In native JavaScript, before ES6 Modules 2015 was introduced had no import, include, or require functionalities. Before that, we can load a JavaScript file into another JavaScript file using a script tag inside the DOM that script will be downloaded and executed immediately. Now after the invention of ES6 modules, there are so many different approaches to solve this problem have been developed and discussed below. ES6 Modules: ECMAScript (ES6) modules have been supported in Node.js since v8.5. In this module, we define exported functions in one file and import them in another example....
read more
How to set timezone offset using JavaScript ?
The timezone offset represents the difference in minutes between local time and Coordinated Universal Time (UTC). Setting the timezone offset in JavaScript involves obtaining the current date’s timezone offset, measured in minutes, from Coordinated Universal Time (UTC). This offset accounts for variations in time between the local timezone and UTC, allowing accurate time representation in applications....
read more
Difference Between Local Storage, Session Storage And Cookies
The HTTP protocol is one of the most important protocols for smooth communication between the server and the client. The main disadvantage of the HTTP protocol is that it is a stateless protocol, which means it does not track any kind of response or request by the server or the client. So in order to resolve this problem, there are three ways to track useful information. In this article, we are going to see the difference between local storage, session storage, and cookies and why it’s important for a web developer to know these terms....
read more
JavaScript Trigger a button on ENTER key
In this article, we will see how to trigger a button on the ENTER key. To trigger a click button on ENTER key, We can use any of the keyup(), keydown() and keypress() events of jQuery....
read more
How to load CSS files using JavaScript?
The CSS file is used to describe how HTML elements will be displayed. There are various ways to add CSS files to the HTML document. JavaScript can also be used to load a CSS file in the HTML document....
read more
How to make the images bigger when clicked?
In this article, we will make the images bigger when clicked. There are two commonly used methods that can be used to resize an image when clicked using javascript. The javascript functions can be invoked by specifying the onclick=”function_name()”...
read more
How to pass an array as a function parameter in JavaScript ?
In this article, we will learn how to pass an array as a function parameter in JavaScript....
read more
How to convert date to another timezone in JavaScript ?
In our globalized world, navigating time zones has become an essential aspect of modern life. Whether it’s scheduling international meetings, coordinating travel plans, or simply staying in touch with friends and family abroad, understanding how to convert dates and times between different time zones is invaluable. In this article, we will learn how to convert the date of one timezone to another....
read more
Check a number is Prime or not using JavaScript
We are given a positive integer N and the task is to find out whether the given number is prime or not. A prime number is a number that is divisible by 1 and itself only....
read more
How to connect SQL Server database from JavaScript in the browser ?
There is no common way to connect to the SQL Server database from a JavaScript client, every browser has its own API and packages to connect to SQL Server. For example, in the Windows operating system, Internet Explorer has a class name called ActiveXObject which is used to create instances of OLE Automation objects, and these objects help us to create an environment for SQL Driver connection....
read more