Javascript
-
Steps to build angular service library.
Concept of Angular Service Libraries Steps To Create an Angular Service Library Example (Data Fetching Service) TypeScript Let’s Build Something… Read More
-
How to Construct Key-Value pair in Javascript ?
Add the below code in your js. // Defines push method to push the key value pair Object.prototype.push = function(… Read More
-
How to remove last occurrence of any character in Javascript ?
Place the following javascript method in your file. String.prototype.reverse = function () return this.split(”).reverse().join(”); ; String.prototype.replaceLast =… Read More
-
How to change url without reloading the page
if (history.pushState) { var newurl = window.location.protocol + “//” + window.location.host + … Read More
-
How to read data list selected value in JS?
How to have data list ? <input list=”profession” id = “optedProfession” type=”search” placeholder=”Select the profession .” required=””> <datalist id=”profession”> <option value=”Player”… Read More
-
How to update URL param in Javascript
function updateURLParam(uri, key, value) { var re = new RegExp(“([?&])” + key + “=.*?(&|$)”, “i”); var params = uri.indexOf(‘?’) !==… Read More
-
How to write a method in Javascript ?
Method 1: function multiply(x,y) { return (x * y); } console.log(multiply(4,2)); // Outputs: 8 Method 2: var multiply = function(x,y)… Read More
-
How to fetch radio button selected value in Javascript or Jquery ?
Using id attribute : var selectedVal = “”; var selected = $(“#radioDiv input[type=’radio’]:checked”); if (selected.length > 0) { selectedVal =… Read More
