Govinda Sai

Govinda Sai

45 Articles Published

Articles by Govinda Sai

Page 2 of 5

What is the usage of onfocus event in JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 678 Views

The onfocus event is triggered when an HTML element receives focus, typically when a user clicks on an input field or navigates to it using the Tab key. This event is commonly used to provide visual feedback or perform actions when users interact with form elements. Syntax // HTML attribute // JavaScript event listener element.onfocus = function() { /* code */ }; element.addEventListener('focus', function() { /* code */ }); Example: Basic onfocus Implementation Click on the input field to see the onfocus effect: ...

Read More

HTML5 using src using raw binary data

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 1K+ Views

HTML5 allows you to embed binary data directly into src attributes using Data URLs. This is particularly useful when working with files stored in databases or when you need to display content without making separate HTTP requests. Data URL Syntax Data URLs follow this format: data:[mediatype][;base64], data Where: mediatype: MIME type (image/png, audio/mp3, etc.) base64: Optional encoding specification data: The actual binary data (base64 encoded if specified) Using Binary Data with Images For images, you can embed binary data directly in ...

Read More

How to force Chrome's script debugger to reload JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 4K+ Views

To force Google Chrome's script debugger to reload JavaScript files, you have several methods depending on your debugging needs. This is essential when cached files prevent you from seeing your latest code changes. Method 1: Using Dev Tools Sources Panel The most direct approach is through Chrome's Developer Tools: Open Dev Tools (F12 or right-click → Inspect) Click on the Sources tab Find your JavaScript file in the file tree Right-click the file and select "Reload" or "Refresh" Method 2: Hard Refresh ...

Read More

What is the role of ctrlKey Mouse Event in JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 309 Views

The ctrlKey mouse event property is a boolean value that indicates whether the CTRL key was pressed when a mouse event occurred. This property is available on all mouse events like click, mousedown, mouseup, etc. Syntax event.ctrlKey Return Value true - if the CTRL key was pressed during the mouse event false - if the CTRL key was not pressed during the mouse event Example The following example demonstrates how to detect if the CTRL key is pressed when clicking on an element: ...

Read More

How to draw a star in HTML5 SVG?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 9K+ Views

SVG stands for Scalable Vector Graphics and is a language for describing 2D-graphics and graphical applications in XML. Most web browsers can display SVG just like they can display PNG, GIF, and JPG. To draw a star in HTML5 SVG, we use the element. The key is to set the correct x and y coordinates for each point of the star, alternating between outer points (tips) and inner points (valleys). 5-Point Star using SVG Polygon ...

Read More

What is the lifetime of JavaScript variables?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 1K+ Views

The lifetime of a JavaScript variable refers to how long it exists in memory, from creation to destruction. Variable lifetime depends on scope and the execution context where it's declared. Local Variable Lifetime Local variables are created when a function is called and destroyed when the function completes execution. They exist only within their function scope. function checkScope() { var localVar = "I'm local"; // Created when function starts console.log(localVar); // localVar is destroyed when function ends } checkScope(); ...

Read More

List of Best JavaScript Frameworks?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 307 Views

JavaScript frameworks simplify web development by providing pre-built components, architecture patterns, and tooling. Here's a comprehensive list of the most popular and widely-used JavaScript frameworks for modern web development. Frontend JavaScript Frameworks React React is a component-based JavaScript library developed by Facebook for building user interfaces. It uses a virtual DOM for efficient rendering and supports JSX syntax for writing HTML-like code in JavaScript. // Simple React component example function Welcome(props) { return Hello, {props.name}!; } // Usage const element = ; Vue.js Vue.js is a progressive JavaScript framework ...

Read More

nParsing IDoc files to extract information from SAP system

Govinda Sai
Govinda Sai
Updated on 13-Mar-2026 958 Views

There are few third party libraries which can be used to perform this task however they involve some cost. The best way here is to use an SAP Connector. SAP Connectors are available for almost all prevalent programming languages like Java, C#, Python. You can program against these connectors and read data from IDoc. You can do many things with these connectors from reading data to converting them to flat files for further usage. Using Java Connector for IDoc Parsing I have used ...

Read More

If a number is read as a String, how to Count the no of times the highest number repeated in the string?n a. Ex: 2 4 3 4 2 4 0 -> (3)

Govinda Sai
Govinda Sai
Updated on 11-Mar-2026 193 Views

To do so, Trim the given string and split it using the split() method (Removing the empty spaces in-between).Create an integer array and in loop convert each element of the string array to an integer using Integer.parseInt() method and assign it to the respective element of the integer array.Sort the obtained integer array, since this method sorts the elements of the array in ascending order the last element will be the maximum of the array. Create an integer variable count with initial value 0. Compare each element of the array with the maximum value, each time a match occurs increment the count. The final value ...

Read More

Multilevel inheritance in Java

Govinda Sai
Govinda Sai
Updated on 10-Dec-2024 90K+ Views

Multilevel inheritance - A class inherits properties from a class which again has inherits properties. Example class Shape {    public void display() {       System.out.println("Inside display");    } } class Rectangle extends Shape {    public void area() {       System.out.println("Inside area");    } } class Cube extends Rectangle {    public void volume() {       System.out.println("Inside volume");    } } public class Tester {    public static void main(String[] arguments) {       Cube cube = new Cube();       cube.display();       cube.area();       cube.volume();    } } Output Inside display Inside area Inside volume Read Also: Java Inheritance

Read More
Showing 11–20 of 45 articles
Advertisements