Found 10483 Articles for Web Development

How to use GoJS HTML5 Canvas Library for drawing diagrams and graphs?

Nancy Den
Updated on 25-Feb-2020 07:01:47

509 Views

GoJS is a JavaScript library, which you can use to implement interactive diagrams. This page will show you the essentials of using GoJS. If you want to add diagrams and graphs, then use this library, which is Open Source.GoJS has a model-view architecture, in which Models holds arrays of JavaScript objects, which describe nodes and links. To visualize this data using actual Node and Link objects, the Diagrams act as views.Constructing a Diagram with GoJS creates an HTML5 Canvas element to be placed inside the given DIV element.How to draw a diagramStart working with GoJS, you need to declare the ... Read More

How can I force clients to refresh JavaScript files?

Shubham Vora
Updated on 10-Aug-2022 11:36:46

12K+ Views

This tutorial teaches us to force clients to refresh JavaScript files. Now, the question is, why do we need to force clients to refresh the JavaScript files? Let’s understand it by example issue. Suppose we have deployed the application and lots of users are using our application. Now, to improve the performance and UI of the application, we will continuously work on our application and upgrade its version after every period. Obviously, after upgrading our application’s version, we will also push that into production. But sometimes, on the user's screen, client-side JavaScript or CSS is not upgraded, and it shows the ... Read More

How to store data in the browser with the HTML5 localStorage API?

Daniol Thomas
Updated on 25-Feb-2020 07:02:41

256 Views

HTML5 localStorage saves string data in the browser and lasts beyond the current session. localStorage stores the data, with no expiration, whereas sessionStorage is limited to the session only. When the browser is closed, the session is lost.The Local Storage is designed for storage that spans multiple windows and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.You can try to run the following code to learn how to work with HTML5 localStorageExampleLive Demo   ... Read More

How to get the absolute value of a number in JavaScript?

Shubham Vora
Updated on 31-Oct-2022 08:01:31

2K+ Views

The space on the number line between any integer and zero is known as its absolute value. No negative values exist because it is the distance. This tutorial will help you find a number's absolute value in JavaScript. Next, we will see the method to find the absolute value of a number in JavaScript. Using Math.abs() A number's absolute value is returned using the Math.abs() function. If n is positive or zero, it returns n, and if n is negative, it returns the negation of n. The Math.abs() is a static function of Math. Hence, we use it as it ... Read More

What are free libraries for Canvas in HTML5?

Yaswanth Varma
Updated on 02-Sep-2022 11:10:33

1K+ Views

Using scripting, the canvas element is utilised to create graphics instantly (usually JavaScript). This tag is just introduced in HTML5. The element serves only as a holding area for images. To draw the visuals, you must utilise a script. There are numerous ways to draw pathways, boxes, circles, characters, and add images on a canvas. Syntax Here is the simple HTML example to depict the usage of canvas − DOCTYPE html> var c=document.getElementById("myCanvas"); var ... Read More

What is the difference between parseInt(string) and Number(string) in JavaScript?

V Jyothi
Updated on 13-Jan-2020 06:29:41

274 Views

parseInt(string)The parseInt() method parses up to the first non-digit and returns the parsed value.  For example, the following returns 765:parseInt("765world")Let’s take another example. The following returns 50:parseInt(‘50px”);Number(string)Number() converts the string into a number, which can also be a float BTW.For example, the following returns NaN:Number(“765world”)The following returns NaN:Number(“50px”);

How to use year input type in HTML?

Yaswanth Varma
Updated on 05-Sep-2022 13:44:45

24K+ Views

Use the placeholder attribute to let the user know that the required input format is YYYY, and the , min, and max attributes to limit the range of possibilities. To the first argument of a new Date, pass the value or valueAsNumber during the input event () Following are the examples… Example In the following example we are using placeholder to mention that the input type is year. DOCTYPE html> document.querySelector("input[type=number]") .oninput = e => console.log(new Date(e.target.valueAsNumber, 0, ... Read More

How to download all images on a web page at once?

Smita Kapse
Updated on 25-Feb-2020 07:18:08

2K+ Views

Chrome Extensions eases your work since it provides more features. To download all images on a web page at once, use a Chrome Extension.Download the Image Downloader chrome extension, which is open source. After adding it to Chrome, you can see the following settings −An icon will be visible in the Chrome browser, which is for Image Downloading. Go to the webpage from where you need the images.On reaching the page, click the extension icon as shown below −Click on the images you want to download or select all from the checkbox. After that click Download and that’s it.Here, you ... Read More

How to use different step attribute in one range input in HTML?

Yaswanth Varma
Updated on 02-Sep-2022 11:08:02

1K+ Views

The permitted number intervals are determined by the HTML input type step property. Steps are numerical steps such as 0, 2, 4, 6, 8, and so on. To construct a range of valid values, combine the step attribute with the max and min properties. They establish a stepping interval on a range which is executed by moving the slider left to right or spinner up and down. If its not explicitly mentioned, default steps are assigned to various input values. Syntax Default step values for different input values are as follows − Input Type ... Read More

What is the correct way of using
,
, or
in HTML?

Yaswanth Varma
Updated on 02-Sep-2022 11:05:24

8K+ Views

There are multiple correct ways to use a br tag in the web documents. In HTML, a line break is made with the tag. We don't need to close because it's an empty tag. To break a line, either or are acceptable. However, tags are used in other web documents like XHTML. But the tag must possess a space before the trailing /> as it helps XHTML to render the existing HTML user agents. Syntax Text text Following are the examples…. Example: (using ) In the following example we are using ... Read More

Advertisements