Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js add query param

function setParam(uri, key, val) {
    return uri
        .replace(RegExp("([?&]"+key+"(?=[=&#]|$)[^#&]*|(?=#|$))"), "&"+key+"="+encodeURIComponent(val))
        .replace(/^([^?&]+)&/, "$1?");
}
Comment

js add query param

function setParam(uri, key, val) {
    return uri
        .replace(RegExp("([?&]"+key+"(?=[=&#]|$)[^#&]*|(?=#|$))"), "&"+key+"="+encodeURIComponent(val))
        .replace(/^([^?&]+)&/, "$1?");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: next js cookie 
Javascript :: math js 
Javascript :: react chart js 2 api data 
Javascript :: react forward ref 
Javascript :: how to change array element to integer in js 
Javascript :: shadow class angular 
Javascript :: === javascript 
Javascript :: javascript unknown number of parameters 
Javascript :: where to find node js logs windows logging node.js howto 
Javascript :: Error: ENOENT: no such file or directory, lstat ode_modules@react-navigationcoresrcgetStateFromPath.tsx 
Javascript :: angular local storage ionic 
Javascript :: array.flat 
Javascript :: react native stylesheet shortcut 
Javascript :: array.push multiple 
Javascript :: loop react components 
Javascript :: expo dependencies 
Javascript :: reverse a string 
Javascript :: permutation and combination program in javascript 
Javascript :: add class to html tag javascript 
Javascript :: how to add the click event into two element in jquery 
Javascript :: new date javascript invalid date 
Javascript :: setinterval() nodejs 
Javascript :: discord.js messageUpdate 
Javascript :: react-native-popup-menu 
Javascript :: dart json serializable 
Javascript :: angularjs make post request 
Javascript :: custom processing datatables 
Javascript :: find object and remove in array 
Javascript :: install axios nodejs 
Javascript :: why bigint js 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =