
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6710 Articles for Javascript

609 Views
The JavaScript script tag is occasionally not understood by older browsers. If not, they will simply disregard it and display your script as though it were a section of the (X)HTML document's body. It's a smart option to use comments to hide scripts from outdated browsers to prevent it from happening. JavaScript is now supported by all modern browsers; however, earlier browsers did not. In this article, we'll learn how to prevent JavaScript code from executing in older browsers. As some of your viewers will be seeing the site on a phone while others are using a large desktop screen, ... Read More

353 Views
In most cases, whenever we use a script tag to load any JavaScript code, the browser pauses HTML processing when it comes across the script tag and begins downloading the JavaScript file first. Until the browser has finished downloading and running the script, the HTML elements script tag will not be activated. The browser waits for the script to download, execute, and then process before processing the rest of the page. The script has a potential to be bigger in newer browsers than the HTML file, which increases the downloading size and processing time. By limiting the user's ability to ... Read More

3K+ Views
To verify whether a webpage has fully loaded, use the DOMContentLoaded and load events. However, there are some elements that influence people's choice for one over the other. Let's have a look at both of them and see how they function. The basic HTML page is loaded and its parsing is completed when the DOMContentLoaded event is fired. Stylesheets, sub-frames, and other add-ons like photos and pictures are not delayed by this event until they have finished loading. When a page has loaded completely, a different event called load should be invoked. When DOMContentLoaded is more appropriate, it is a ... Read More

982 Views
A face that is animated using JavaScript, HTML, and CSS. The face will move in the same direction as the cursor. This is one of the basic CSS and JavaScript effects. It is among the best examples for learning the idea of pseudo-elements for a newcomer. When it comes to arranging and structuring website pages, CSS is far more useful and essential. A website page can now have more capabilities and collaborations because of JavaScript's continued development. CSS is supported by every software, however JavaScript is only supported by functional programmes. You can use JavaScript to create responses for particular ... Read More

2K+ Views
In this tutorial, we'll use JavaScript, CSS, and HTML to build a Site Bookmark app. Through the use of our browser's local storage, we will be able to store links to our favourite websites without having to use any databases. We can store data client-side thanks to Local Storage, also referred to as the web storage API. Strings are used to represent the data in local storage, which is persistent even when the session is closed. Data can only be deleted manually by the user. Since all of the data is stored on the client side, there is a clear ... Read More

1K+ Views
In this tutorial, we will learn why to split the tag when writing it with the document.write(). The script tag in HTML is added to execute JavaScript code on the webpage. The JavaScript programs must be enclosed with the script tag to execute. There are many methods in JavaScript that add HTML content to the page, like the document.write() method. The document.write() method is used to delete all the content from the HTML tag or the document and add the content specified in this method to the page. Because of performance degradation and errors in certain conditions, this method ... Read More

93K+ Views
In this tutorial, we shall learn to stop form refreshing the page on submitting in JavaScript. Let’s cover the methods to accomplish this objective. Using event.preventDefault() to stop page refresh on form submit In this section, we will see how to use event.preventDefault() to stop page refresh on form submission. The event.preventDefault() restricts the default page refresh behavior of the form during form submission. Users can follow the syntax below to try this method. Syntax The syntax defines the form. //Get form element var form=document.getElementById("formId"); function submitForm(event){ ... Read More

452 Views
In this tutorial, we will learn if it is possible to write data to files using only JavaScript. JavaScript has a library named fs (short form of File-System) that manages all writing operations. It is a JavaScript program (fs.js) with functions for writing operations. Utilize functions to write text to system files by importing the fs module into the program. For example, the writeFile() function will erase all old data from a file and create a new one with the specified name if there isn’t already one. It is mainly used for writing operations. The File-System module is a handy ... Read More

564 Views
In this tutorial, we will learn about how to Access the Correct “this” inside a callback. “this” keyword Each function contains a keyword called this, also known as “the context, ” whose value is determined by how the function was called and not by how, when, or where it was defined. Unlike other variables, it is unaffected by lexical scopes. Compared to other languages, JavaScript acts a little differently when a function’s “this” keyword is used. Between strict mode and non-strict mode, there are several further changes. How a function is called most often determines the value of “this” (runtime ... Read More

3K+ Views
We can Use the canvas.toDataURL() to capture HTML canvas as different file formats, such as gif, png, jpg, webp, etc. Capture HTML Canvas as png Example Herein, after using canvas.DataURL(), set the type to image/png to allow saving the image as PNG − window.onload = function() { var canvas = document.getElementById("myCanvas"); var context = canvas.getContext("2d"); context.fillStyle ... Read More