Javascript Articles

Page 383 of 534

Top frameworks for HTML5 based mobile development

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 286 Views

The following are some of the top frameworks for HTML5 based mobile development, each offering unique advantages for creating cross-platform mobile applications: Kendo UI Kendo UI provides a comprehensive suite of HTML5 UI widgets and tools for building cross-platform mobile applications. It offers native-like performance and appearance across different devices and operating systems. // Basic Kendo UI Mobile App initialization var app = new kendo.mobile.Application(document.body, { transition: 'slide', layout: 'tabstrip-layout' }); Bootstrap Bootstrap is a responsive front-end framework that supports HTML, CSS, and JavaScript for ...

Read More

Determining full house in poker - JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 476 Views

A "full house" in poker is a hand containing three cards of one rank and two cards of another rank (e.g., three Kings and two Aces). We need to write a JavaScript function that checks if an array of five cards represents a full house. Understanding Full House A full house requires exactly: Three cards of the same rank (three of a kind) Two cards of another same rank (a pair) Example Implementation Here's a JavaScript function to detect a full house: const arr1 = ['K', 'K', 'K', 'A', 'A']; // Full ...

Read More

Create a text inside circles in HTML5 Canvas

Nishtha Thakur
Nishtha Thakur
Updated on 15-Mar-2026 1K+ Views

To create text inside circles in HTML5 Canvas, you need to draw a circle first using context.arc(), then add text at the center using context.fillText(). This technique is useful for creating badges, labels, or interactive elements. Basic Approach The process involves three main steps: Draw a circle using beginPath() and arc() Fill the circle with a background color Add centered text with contrasting color Example: Static Circle with Text var canvas = document.getElementById('canvas1'); var context = canvas.getContext('2d'); // Draw circle context.beginPath(); context.fillStyle = "blue"; context.arc(100, 100, 30, 0, ...

Read More

Mapping the letter of a string to an object of arrays - JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 496 Views

Given a string, we are required to write a function that creates an object that stores the indexes of each letter in an array. The letters (elements) of the string must be the keys of object. The indexes should be stored in an array and those arrays are values. For example, if the input string is: const str = 'cannot'; Then the output should be: const output = { 'c': [0], 'a': [1], 'n': [2, 3], ...

Read More

Upload directly to Amazon S3 using Plupload HTML5 runtime

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 193 Views

Amazon S3 supports cross-origin resource sharing (CORS), enabling direct HTML5 file uploads from web browsers using Plupload. This eliminates the need for server-side proxies and provides a more efficient upload experience. What is CORS in Amazon S3? Cross-Origin Resource Sharing (CORS) allows web applications running on one domain to make requests to Amazon S3 buckets on a different domain. Without CORS, browsers block these cross-origin requests for security reasons. Setting Up CORS Configuration First, configure your S3 bucket's CORS policy to allow uploads from your domain: { "CORSRules": [ ...

Read More

Finding shared element between two strings - JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 629 Views

We are required to write a JavaScript function that takes in two strings that may / may not contain some common elements. The function should return an empty string if no common element exists otherwise a string containing all common elements between two strings. Following are our two strings − const str1 = 'Hey There!!, how are you'; const str2 = 'Can this be a special string'; Example Following is the code − const str1 = 'Hey There!!, how are you'; const str2 = 'Can this be a special string'; const ...

Read More

Open a file browser with default directory in JavaScript and HTML?

V Jyothi
V Jyothi
Updated on 15-Mar-2026 1K+ Views

Opening a file browser with a default directory is not possible in JavaScript due to security restrictions. Web browsers prevent websites from accessing or setting specific file system paths to protect user privacy and system security. Why Default Directory Setting is Restricted Browsers block this functionality for several security reasons: Prevents websites from accessing sensitive system directories Protects user privacy by hiding file system structure Avoids potential security exploits through path manipulation Directory paths may not exist on different operating systems Standard File Input Behavior The HTML file input always opens in the ...

Read More

Finding letter distance in strings - JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 773 Views

We are required to write a JavaScript function that takes in a string as first argument and two single element strings. The function should return the distance between those single letter strings in the string taken as first argument. For example − If the three strings are − const str = 'Disaster management'; const a = 'i', b = 't'; Then the output should be 4 because the distance between 'i' and 't' is 4 Understanding Letter Distance Letter distance is the absolute difference between the index positions of two characters in ...

Read More

Effects and animations with Google Maps markers in HTML5

Samual Sam
Samual Sam
Updated on 15-Mar-2026 302 Views

Google Maps API doesn't provide built-in fade or animation effects for standard markers. However, you can create custom animations by implementing Custom Overlays that give you full control over marker appearance and behavior. Why Custom Overlays? Standard Google Maps markers have limited animation options. Custom overlays allow you to: Control opacity and CSS transitions Create fade in/out effects Add custom animations using CSS or JavaScript Implement bounce, slide, or rotation effects Creating a Custom Overlay Class // Custom overlay class extending Google Maps OverlayView function CustomMarker(position, map, content) { ...

Read More

What are the differences between group and layer in KineticJs with HTML?

Daniol Thomas
Daniol Thomas
Updated on 15-Mar-2026 584 Views

In KineticJS, groups and layers serve different organizational purposes when building HTML5 canvas applications. Understanding their differences is crucial for proper scene management. What are Groups? Groups are containers that hold multiple shape objects within a layer. They allow you to treat multiple shapes as a single unit for transformations and event handling. var stage = new Konva.Stage({ ...

Read More
Showing 3821–3830 of 5,340 articles
« Prev 1 381 382 383 384 385 534 Next »
Advertisements