Johar Ali

Johar Ali

31 Articles Published

Articles by Johar Ali

31 articles

Static HTML elements are written directly in SAPUI5

Johar Ali
Johar Ali
Updated on 16-Mar-2026 571 Views

SAPUI5 allows developers to use their own static HTML elements alongside UI5 controls. It is not a closed framework − you can use the sap.ui.core.HTML control to write plain HTML within any area rendered by UI5, making it easy to mix static HTML and UI5 controls in the same view. HTML created by UI5 controls is generated dynamically at runtime. This is how most JavaScript UI libraries work when providing higher-level UI elements that would be complex to write in static HTML alone. However, SAPUI5 gives you the flexibility to embed your own static HTML whenever needed. ...

Read More

How to block a website in your web browsers (Chrome and Internet Explorer)

Johar Ali
Johar Ali
Updated on 15-Mar-2026 404 Views

To block a website on web browsers like Google Chrome, Firefox, and Internet Explorer in a Windows system, you can modify the system's hosts file. This method works by redirecting website requests to your local machine. How It Works The hosts file acts as a local DNS lookup table. When you add an entry like 127.0.0.1 website.com, your system redirects that website to your local machine (127.0.0.1), effectively blocking access. Step-by-Step Instructions Step 1: Open Notepad as an administrator by right-clicking on Notepad and selecting Run as Administrator. Step 2: In Notepad, click File → ...

Read More

How to change Firefox Browser theme?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 424 Views

Firefox web browser is widely used and loved by many users around the world. You can easily change the Firefox Browser theme to customize its appearance and make it look more awesome. Let's see how to reach the Firefox theme section and change the theme: Step 1: Open Firefox Menu Go to the Firefox browser menu by clicking the three horizontal lines (hamburger menu) in the top-right corner. From the dropdown menu, click on "Add-ons and themes": ...

Read More

How to use the tag to define a relationship to an external resource?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 291 Views

The tag is used in HTML to define a relationship to an external resource. It is most commonly used to link external style sheets to HTML documents. The tag is placed inside the section and is a self-closing tag, meaning it does not require a closing tag. Syntax Key Attributes The tag uses several important attributes: rel - Specifies the relationship between the current document and the linked resource href - Specifies the URL of the external resource type - Specifies the media type of the linked resource ...

Read More

What is the difference between: var functionName = function() {} and function functionName() {} in Javascript

Johar Ali
Johar Ali
Updated on 15-Mar-2026 405 Views

In JavaScript, there are two primary ways to define functions: function expressions and function declarations. The key difference lies in how JavaScript processes them during execution. Function Declaration vs Function Expression A function declaration is defined using the function keyword followed by the function name, while a function expression assigns a function to a variable. // Function Declaration function functionName() { // code } // Function Expression var functionName = function() { // code }; Hoisting Behavior The main difference is how JavaScript handles ...

Read More

Why JavaScript 'var null' throw an error but 'var undefined' doesn't?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 233 Views

In JavaScript, var null throws a syntax error because null is a reserved keyword, while var undefined works because undefined is not a reserved identifier. Reserved Keywords in JavaScript JavaScript has reserved keywords that cannot be used as variable names. These include: null true false if for while function var let const Why 'var null' Throws an Error When you try to declare a variable named null, JavaScript throws a syntax error: // This will throw a SyntaxError var null = "some value"; SyntaxError: Unexpected token 'null' ...

Read More

What is the difference between Declaring and Initializing a variable in JavaScript?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 561 Views

In JavaScript, declaring a variable means creating it in memory, while initializing means assigning it a value. Understanding this distinction is crucial for avoiding common bugs. What is Variable Declaration? Declaration creates a variable in the current scope and allocates memory for it. The variable exists but has no assigned value. var name; // Declaration only let age; // Declaration only const PI; // Error! const must be initialized SyntaxError: Missing ...

Read More

How does the browser identify inline JavaScripts?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 490 Views

When HTML contains JavaScript code directly within HTML elements or script tags, browsers use specific mechanisms to identify and execute this inline JavaScript. Event Handler Attributes Browsers automatically detect JavaScript in HTML event attributes like onclick, onload, onmouseover, etc., even without explicit tags. Inline JavaScript Example Hover over this text In this example, the browser identifies JavaScript code in ...

Read More

How to handle when JavaScript is turned off?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 183 Views

When JavaScript is disabled in a browser, web pages may lose functionality or display incorrectly. The HTML tag provides a fallback solution by displaying alternative content when JavaScript is unavailable or turned off. What is the noscript Tag? The tag defines content that should be displayed only when JavaScript is disabled or not supported by the browser. This tag helps ensure your website remains accessible to all users, regardless of their JavaScript settings. Syntax Basic Example JavaScript ...

Read More

How to pass JavaScript variables to PHP?

Johar Ali
Johar Ali
Updated on 15-Mar-2026 21K+ Views

You can pass JavaScript variables to PHP using several methods. Since PHP runs on the server and JavaScript runs in the browser, direct variable passing isn't possible. However, you can achieve this through AJAX requests, form submissions, or by embedding JavaScript values in PHP output. Method 1: Using AJAX POST Request The most common approach is to send JavaScript variables to PHP using AJAX − Pass JS to PHP Send Data to PHP ...

Read More
Showing 1–10 of 31 articles
« Prev 1 2 3 4 Next »
Advertisements