Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Javascript Articles
Page 311 of 534
With JavaScript RegExp search a hexadecimal number character.
To find a hexadecimal number character with JavaScript Regular Expression, use the \x escape sequence followed by the two-digit hexadecimal value. Syntax \xdd Where dd represents the two-digit hexadecimal value (00-FF) of the character you want to match. Example: Searching for Hexadecimal Character The following example searches for hexadecimal number 53, which represents the character 'S': JavaScript Regular Expression ...
Read MoreSharedArrayBuffer.byteLength Property in JavaScript
The byteLength property of the SharedArrayBuffer returns an unsigned, 32-bit integer that specifies the size/length of a SharedArrayBuffer in bytes. Syntax sharedArrayBuffer.byteLength Parameters This property takes no parameters and is read-only. Return Value Returns the length of the SharedArrayBuffer in bytes as a 32-bit unsigned integer. Example JavaScript Example var sharedArrayBuffer = new SharedArrayBuffer(8); ...
Read MoreHow to load the next URL in the history list in JavaScript?
In this tutorial, we will learn to load the next page in the history list in JavaScript. The Window object in JavaScript accesses the window in the browser. This object contains many properties and methods required to do the tasks. The Window object also retrieves the information from the browser window. There is a history stack in every browser that saves the pages visited by the user. To access this history stack, we can use the history object that is the property of the Window object. By accessing the history from the browser, we can go to the ...
Read MoreWhich event occurs in JavaScript when a dragged element is dropped?
The ondrop event occurs when a dragged element is successfully dropped on a valid drop target. This event is part of the HTML5 Drag and Drop API and must work together with ondragover to enable dropping functionality. How Drag and Drop Works The drag and drop process involves several events: ondragstart - When dragging begins ondragover - When dragged element is over a drop target ondrop - When element is dropped on target ondragend - When dragging operation ends Key Requirements For ondrop to work properly: The drop target must handle ondragover and ...
Read MoreTypedArray.buffer property in JavaScript
The buffer property of TypedArray instances provides access to the underlying ArrayBuffer object that stores the binary data for the typed array. Syntax typedArray.buffer Return Value Returns the ArrayBuffer object that backs the TypedArray instance. Example JavaScript Example var buffer = new ArrayBuffer(156); var float32 = new Float32Array(buffer); document.write("Buffer byte length: " + float32.buffer.byteLength); ...
Read MoreHow to return the "time" portion of the Date as a string using the current locale's conventions?
To return the "time" portion of the Date as a string, using the current locale's conventions, use the toLocaleTimeString() method. The toLocaleTimeString() method relies on the underlying operating system in formatting dates. It converts the date to a string using the formatting convention of the operating system where the script is running. For example, in the United States, the time appears in 12-hour format with AM/PM, whereas in many European countries, it appears in 24-hour format. Syntax date.toLocaleTimeString([locales], [options]) Parameters locales (optional): A string or array of strings representing locale identifiers (e.g., ...
Read MoreTypedArray.byteLength property in JavaScript
The byteLength property of the TypedArray object represents the length of the TypedArray in bytes. It is a read-only property that returns the size of the underlying buffer used by the typed array. Syntax typedArray.byteLength Example: Basic Usage JavaScript Example var buffer = new ArrayBuffer(156); var float32 = new Float32Array(buffer); document.write("ByteLength: " + float32.byteLength); ...
Read MoreHow to return a string representing the source for an equivalent Date object?
The toSource() method was a non-standard JavaScript method that returned a string representing the source code of a Date object. However, this method has been deprecated and removed from modern browsers. The Deprecated toSource() Method The toSource() method was originally available in Firefox but was never part of the ECMAScript standard. It would return a string that could theoretically recreate the Date object: // This method is deprecated and no longer works var dt = new Date(2018, 0, 15, 14, 39, 7); // dt.toSource() would have returned: (new Date(1516022347000)) Modern Alternatives Since toSource() ...
Read MoreTypedArray.byteOffset property in JavaScript
The byteOffset property of TypedArray returns the offset (in bytes) from the start of the ArrayBuffer where the typed array begins. Syntax typedArray.byteOffset Parameters This is a property, not a method, so it takes no parameters. Return Value Returns a number representing the byte offset from the beginning of the ArrayBuffer. Example 1: TypedArray at Buffer Start JavaScript byteOffset Example var buffer = new ArrayBuffer(16); ...
Read MoreHow to load the previous URL in the history list in JavaScript?
In this tutorial, we will learn to load the previous page in the history list in JavaScript. The Window object in JavaScript accesses the window in the browser. This object contains many properties and methods required to do the tasks. The Window object also retrieves the information from the browser window. There is a history stack in every browser that saves the pages visited by the user. To access this history stack, we can use the history object that is the property of the Window object. By accessing the history from the browser, we can go to the ...
Read More