Questions tagged [urlsearchparams]
65 questions
0
votes
1 answer
what is different of set vs append
In Javascript, URLSearchParams Is it different "set" between "append"?
const test = new URLSearchParams();
test.append("name", "Harry Potter");
const test = new URLSearchParams();
test.set("name", "Harry Potter");
^ different?

Esteban
- 15
- 3
0
votes
0 answers
Tracking state in URL params over multiple React components
I have a page which shows a list of items. These items are paginated, and can be searched, filtered, and ordered.
IndexComponent
-> SidebarComponent
-> FilterComponentA
-> OrderComponentB
-> ListContainerComponent
-> SearchComponent
->…

BeaverusIV
- 988
- 1
- 11
- 26
0
votes
1 answer
Reading the parameter values off the current URL on page load
I realize retrieving search params from the URL is a commonly asked Question but I am running into an issue with using URLSearchParams(window.location.search) because I believe it is searching for a ? and my url contains & as separators between…

CourtneyJ
- 458
- 6
- 19
0
votes
2 answers
Add paramters to URL with click functions
I want to add parameters to the actual url depending on the selected values. The values will be set with a click function and should work independently from each other.
I've set global variables to store the click function values, but they don't get…

Keroster
- 23
- 7
0
votes
1 answer
MongoDB find an array that contains one of the elements from another array
I'm doing a school project and I'm stuck :(
When the url is ".../?liked=true" I want to show only likedInterns.
likedInterns is an array with IDs = ['628f8f1f7a7a944bd8927c1b', '6291241d80feece846cbc104', '628f8f1f7a7a944bd8927c1a']
I can't find…

Wiktorrwie
- 3
- 1
0
votes
1 answer
URLSearchParams not parsing query string
Using react-router-dom version 5.
Some component, rendered when matching a :
...
const { search } = useLocation();
const params = new URLSearchParams(search);
useEffect(() => {
console.log(search); // "?paramOne=1¶mTwo=2"
…

PLTRNX
- 11
- 2
0
votes
0 answers
How to triger a filter on a antd table with searchParams
I am using an antd table with a customized filter and I am trying to implement a new feature using URL search params to save time when sharing filtered results with colleagues, the idea is to share links.
The search params are being set on the URL…

R2-D2
- 3
- 3
0
votes
2 answers
How to ignore invalid URL parameters?
Before I go on, let me say that I've looked through a number of threads already and can't find an answer that works for me.
Basically, I've built a custom link shortener and I'm using URLSearchParams to pull the URL to be shortened and the custom…

Owen Sullivan
- 103
- 2
- 9
0
votes
1 answer
Remove assoc array from query string
I like to remove an array variable conditions from a query string which will be window.location.search.
First output Before is the initial string.
Second is after removing sub
Third still contains conditions.
How can I get rid of it?
edit
The…

Xaver
- 11,144
- 13
- 56
- 91
0
votes
0 answers
Why would a dictionary variable be undefined in async function
I'm trying to figure out why the variable ROOT_FOLDER_LOCATION is undefined. The function is running as a google "cloud function" and it is triggered from ZOHO CRM in which it is sent URL encoded data containing the variables 'ID', 'firstName',…

jim
- 53
- 5
0
votes
2 answers
Best way to pass parentheses in URL?
I have turn to the API, which apparently accepts parameters for a redirecting request as one of the parameters. I prefer use the URL object to create requests. To add and encode parameters, I use searchParams. But searchParams encodes, among other…

whoisYeshua
- 11
- 4
0
votes
0 answers
Node/Mongoose: ObjectId from array in URL search params
I have a Mongoose schema called events which includes an array of vendors:
vendors: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "Vendor"
}
],
I am trying to execute a query in URL search params on the first…

PYP
- 125
- 13
0
votes
0 answers
new Date() turning date into US format
I'm trying to compare a date from a URL, with today's date. (I want to check, if the date from the URL, is within 28 days, from today's date).
Here's my code, which kinda works:
let params = (new…

Reena Verma
- 1,617
- 2
- 20
- 47
0
votes
1 answer
Date string getting altered when passed in via URLSearchParams
I'm building a dashboard that will pull in data via an HTTP request. In order to get the data, I have to include date based "start" and "end" search params in the URL, so I decided to use URLSearchParams to allow this to be somewhat…

Vincent Levinger
- 31
- 6
0
votes
1 answer
Constructing URL search parameters in Shiny app?
I have a Shiny app that wrangles a large csv file. Currently the user can select a facility_id number from a drop down menu to get a specific plot, see https://r.timetochange.today/shiny/Annual_Emissions2/. I would like to pass this id with a URL…

Brian Holmes
- 17
- 5