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
Articles by Johar Ali
31 articles
Static HTML elements are written directly in SAPUI5
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 MoreHow to block a website in your web browsers (Chrome and Internet Explorer)
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 MoreHow to change Firefox Browser theme?
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 MoreHow to use the tag to define a relationship to an external resource?
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 MoreWhat is the difference between: var functionName = function() {} and function functionName() {} in Javascript
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 MoreWhy JavaScript 'var null' throw an error but 'var undefined' doesn't?
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 MoreWhat is the difference between Declaring and Initializing a variable in JavaScript?
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 MoreHow does the browser identify inline JavaScripts?
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 MoreHow to handle when JavaScript is turned off?
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 MoreHow to pass JavaScript variables to PHP?
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