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
Front End Scripts Articles
Page 19 of 47
Storing Credentials in Local Storage
Local Storage is designed for data that spans multiple windows and persists beyond the current session. Web applications can store megabytes of user data on the client side for performance reasons. However, storing credentials requires special security considerations. For secure credential storage, never store actual passwords or sensitive authentication data directly in local storage. Instead, use a token-based approach that minimizes security risks. Secure Token-Based Authentication On successful login, generate a completely random token string unrelated to user credentials. Store this token in your database with an expiry date, then pass it to JavaScript for local storage. ...
Read MoreHow to display HTML5 client-side validation error bubbles?
HTML5 provides built-in client-side validation with error bubbles that appear when users try to submit invalid form data. The required attribute and input types like email automatically trigger these validation messages. Basic Required Field Validation The required attribute prevents form submission if the field is empty and displays a validation bubble: HTML5 Validation Enter Email: ...
Read MoreHow not to validate HTML5 input with required attribute
To avoid validation on specific form elements in HTML5, use the formnovalidate attribute on submit buttons or the novalidate attribute on the form itself. This allows you to bypass HTML5's built-in validation for required fields when needed. Using formnovalidate Attribute The formnovalidate attribute can be added to submit buttons to skip validation for that specific submission: HTML formnovalidate attribute Rank: ...
Read MoreSet a dotted line for the border with CSS
To set a dotted line for the border in CSS, use the border-style property with the value dotted. This creates a border made up of small dots around the element. Syntax border-style: dotted; Example Here's how to create a dotted border using CSS: .dotted-border { border-width: 3px; ...
Read MoreCSS content: attr() on HTML5 progress doesn't work
The CSS content: attr() function doesn't work directly with HTML5 elements due to browser rendering limitations. Here's how to work around this issue. The Problem When you try to use content: attr() with progress elements, it fails because progress bars use special internal pseudo-elements that don't support generated content in the same way as regular elements. HTML Structure .progress-container { position: relative; ...
Read MoreHow to best display HTML5 geolocation accuracy on a Google Map?
To display HTML5 geolocation accuracy on a Google Map, you need to combine the Geolocation API with Google Maps to show both the user's position and the accuracy radius as a circle. Basic Setup First, get the user's location using the HTML5 Geolocation API and extract the accuracy information: Geolocation Accuracy on Map function initMap() { ...
Read MoreWhat HTML5 File.slice method actually doing?
The HTML5 Blob.slice() method creates a new Blob object containing a subset of data from the source Blob. It's particularly useful for processing large files in chunks or extracting specific portions of binary data. Syntax blob.slice(start, end, contentType) Parameters The slice() method accepts three optional parameters: start - Starting byte position (default: 0) end - Ending byte position (default: blob.size) contentType - MIME type for the new blob (default: empty string) Basic Example // Create a blob with text content var originalBlob = new ...
Read MoreUsage of border-right-color property in CSS
The border-right-color property sets the color of an element's right border. It works independently of other border properties and allows you to customize just the right border color while leaving other borders unchanged. Syntax border-right-color: color | transparent | inherit; Values color - Any valid CSS color (hex, RGB, HSL, color names) transparent - Makes the border transparent inherit - Inherits the color from parent element Example: Basic Usage .demo { ...
Read MoreHow to draw a 3D sphere in HTML5?
To create a 3D sphere in HTML5, you need to use the canvas element along with mathematical calculations to plot points in 3D space and project them onto a 2D canvas. This involves creating vertices using spherical coordinates and rendering them as a wireframe or solid sphere. Basic Sphere Class Structure First, let's create a Point3D class and a sphere display function: 3D Sphere // Point3D class to represent ...
Read MoreHTML5 video not working with jquery bxSlider plugin on iPad
When using HTML5 video with the bxSlider jQuery plugin on iPad, video playback often fails due to iOS-specific requirements and plugin compatibility issues. This guide shows how to properly configure bxSlider to work with HTML5 videos on iPad. Setup Requirements First, download the bxSlider plugin from the official website. Extract the downloaded zip file and locate the images folder. Copy this images folder into your project's js directory. Required Files Structure Include the following files in your project with proper linking: HTML Structure for Video Slider Structure ...
Read More