Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

JavaScript Fetch API

JavaScript Fetch API Summary: in this tutorial, you’ll learn about the JavaScript Fetch API and how to use it to make asynchronous HTTP requests. The Fetch API is a modern interface that allows you to make HTTP requests to servers from web browsers. If you have worked with XMLHttpRequest (XHR) object, the Fetch API can…
Read more

JavaScript History pushState

JavaScript History pushState Summary: in this tutorial, you’ll learn how to use the JavaScript history pushState() method. Introduction to the JavaScript history pushState() method The history.pushState() method allows you to add an entry to the web browser’s session history stack. Here’s the syntax of the pushState() method: history.pushState(state, title, [,url]) Code language: CSS (css) The…
Read more

JavaScript Scale

JavaScript Scale Summary: in this tutorial, you’ll learn how to use the JavaScript scale() Canvas API to scale drawing objects effectively. Introduction to JavaScript scale() Canvas API The scale() is a method of the 2D drawing context. The scale() method adds a scaling transformation to the canvas units horizontally and/or vertically. The default unit on…
Read more

JavaScript Rotate

JavaScript Rotate Summary: in this tutorial, you’ll learn how to use the JavaScript rotate() method to rotate drawing objects. Introduction to JavaScript rotate() canvas API The rotate() is a method of the 2D drawing context. The rotate() method allows you to rotate a drawing object on the canvas. Here is the syntax of the rotate()…
Read more

JavaScript Translate

JavaScript Translate Summary: in this tutorial, you’ll learn how to use the JavaScript translate() API to move the origin of the canvas to the new position. Introduction to the JavaScript translate() method. The translate() is a method of a 2D drawing context. The translate(x,y) method moves the canvas and its origin x units horizontally and…
Read more

JavaScript fillText

JavaScript fillText Summary: in this tutorial, you’ll learn how to use the JavaScript fillText() method to draw a text string to a canvas. Introduction to the JavaScript fillText() method The fillText() is a method of a 2D drawing context. The fillText() method allows you to draw a text string at a coordinate with the fill…
Read more

How to Draw a Line in JavaScript

How to Draw a Line in JavaScript Summary: in this tutorial, you’ll learn how to draw a line using the Canvas API. Steps for drawing a line in JavaScript To draw a line on a canvas, you use the following steps: First, create a new line by calling the beginPath() method. Second, move the drawing…
Read more

Canvas clearRect

Canvas clearRect Summary: in this tutorial, you’ll learn how to use the clearRect() method to erase an area of the canvas. Introduction to the Canvas clearRect() method The clearRect() is a method of the 2D drawing context. The clearRect() method clears an area of the canvas by making that area transparent. In practice, you draw…
Read more

JavaScript strokeRect

JavaScript strokeRect Summary: in this tutorial, you’ll learn how to use the JavaScript strockRect() method to draw an outlined rectangle on a canvas. Introduction to the JavaScript strokeRect() method The strokeRect() is a method of the 2D drawing context. The strokeRect() allows you to draw an outlined rectangle with the stroke style derived from the…
Read more

JavaScript fillRect

JavaScript fillRect Summary: in this tutorial, you’ll learn how to use the JavaScript fillRect() method to draw rectangles with a specified width and height on a canvas. Introduction to the JavaScript fillRect() method The fillRect() is a method of the 2d drawing context object. The fillRect() method allows you to draw a filled rectangle at…
Read more