Found 10483 Articles for Web Development

How do I remove a particular element from an array in JavaScript

Revathi Satya Kondra
Updated on 10-Feb-2025 11:16:54

981 Views

In JavaScript, Removing a particular element from an array refers to the process of deleting or filtering out a particular element from the array. so that a element is no longer exists within that array. The Arrays are the most commonly used data structures in JavaScript, allowing developers to store and manipulate collections of items. Syntax Following is the syntax to remove a particular element from an array. array(index, deleteCount[, element1[, element2[, ...]]]) Parameters Here, we have three parameters to remove a particular element from an array in JavaScript − index − The index ... Read More

Static HTML elements are written directly in SAPUI5

Johar Ali
Updated on 30-Jul-2019 22:30:20

505 Views

SAPUI5 allows the developer to use their own static HTML elements with the use of UI5 controls in certain areas. It is not closed framework and allows you to use a sap.ui.core.HTML control to write any amount of plain HTML within an area rendered by UI5 so it allows you to easily mix HTML and UI5 controls.HTML created by UI5 controls, however, is created dynamically, but that's how many JavaScript UI libraries work when providing higher-level UI elements that would be hard to write in static HTML.You can refer to below link of SAPUI5 which tells more about HTML SAPUI5 ... Read More

Page build in HTML and wanted to load into JS view in SAPUI5 application.

Ali
Ali
Updated on 25-Feb-2020 11:06:12

558 Views

The most commonly used way of doing this is to embed the HTML page as an iframe. Here is the example.new sap.ui.core.HTML({    preferDOM: true,    content: "" });It can also be loaded using AJAX call or display using sap.ui.core.HTML, but it will depend upon your HTML page.

In dynamic fashion setting a custom class to a cell in a row

Amit Sharma
Updated on 25-Feb-2020 11:07:08

118 Views

If you need to set CSS properties for a row, then what you can try is to use the predefined CSS class of the table along with the custom class. For Example.sapMListTbl . {    margin: 10px;    color: #ffffff; }Also, you can opt for a formatter while applying the new class along with your model classes.

How to check whether a string contains a substring in JavaScript?

Abhinaya
Updated on 20-Apr-2022 12:44:47

902 Views

JavaScript provides us with different methods to check whether a string contains a substring or not. In this article, we use the following three methods for this purpose-String search() methodString indexOf() methodString includes() methodLet’s explore in detail each method.1. String search() methodThe string search method can be used to search a text (using regular expression) in a string.It matches the string against a regular expression and returns the index (position) of the first match.It returns -1 if no match is found. It’s case-sensitive.The string search() method is an ES1 feature. It is fully supported in all browsers.Syntaxstring.search(searchValue)searchValue is a regular ... Read More

Why do we use "use strict" in JavaScript?

Govinda Sai
Updated on 20-Apr-2022 12:30:05

735 Views

The “use strict” is a directive, which is a literal expression. It was introduced in JavaScript 1.8.5. As the name suggests, “use strict” indicates that the code is to be executed in strict mode.Benefits of using “use strict”It’s easier to write "secure" JavaScript codes.It changes previously accepted "bad syntax" into real errors. As an example, mistyping a variable name creates a new global variable. When using strict mode, this will throw an error. It leads to making it impossible to accidentally create a global variable.A programmer will not receive any error feedback assigning values to non-writable properties.But in strict mode, ... Read More

How to redirect to another webpage using JavaScript?

Ramu Prasad
Updated on 20-Apr-2022 12:40:56

21K+ Views

The window.location object contains the current location or URL information. We can redirect the users to another webpage using the properties of this object. window.location can be written without the prefix window.We use the following properties of the window.location object to redirect the users to another webpage −window.location.href- it returns the URL (href) of the current page.window.location.replace()- it replaces the current document with new document.window.location.assign() loads a new document.The syntaxes below are used to redirect to another web page. We omit the window prefix and use only location in all the program examples. You can try running the programs using ... Read More

Which equals operator (== vs ===) should be used in JavaScript comparisons

Sravani S
Updated on 12-Sep-2019 07:10:20

154 Views

Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison.For example,4 == 4     // true '4' == 4   // true 4 == '4'   // true 0 == false // trueTriple equals (===) are strict equality comparison operator, which returns false for different types and different content.For example,4 === 4     // true 4 === '4'   // false var v1 = {'value': 'key'}; var v2 = {'value': 'key'}; v1 === v2   //false

Using CSS3 in SAP BSP application without using DOCTYPE tag

Amit Sharma
Updated on 30-Jul-2019 22:30:20

224 Views

To add a DOCTYPE tag without changing code of your BSP application, you can try using in Web Server, JQuery, or other UI libraries.There are various other libraries that you can search for as a replacement for CSS3 and they have their own advantage. I have used JQuery UI, Wijmo or Modernizer.

Where do we use $.extend() method in jQuery?

David Meador
Updated on 15-Jun-2020 13:18:40

1K+ Views

The jQuery.extend() method is used to merge contents of two or more objects together. The object is merged into the first object. You can try to run the following code to learn how to use extend() method −ExampleLive Demo $(document).ready(function() {   $("#button1").click(function() {     var obj1 = {       maths: 60,       history: {pages: 150,price: 400,lessons: 30},       science: 120     };     var obj2 = {       history: { price: 150, lessons: 24 },       economics: 250     };     $.extend(true, obj1, obj2);     $("#demo").append(JSON.stringify(obj1));    }); });    Result    

Advertisements