0👍
I finally found my problem.
I was having umlauts(ö, ä, ü) in my searchTerm
so I had to use encodeURI()
on my searchTerm
first.
0👍
try this to remove search param:
const url = 'https://example.com/posts?page=5&sort=desc';
const urlObj = new URL(url);
urlObj.search = '';
const result = urlObj.toString();
console.log(result); // https://example.com/posts
- [Vuejs]-Put together values from inputs and add "?" or "!" to create a link using Vue.js
- [Vuejs]-How to handle different toolbars for different pages in vue.js
-2👍
Use substring() function to get the part you want and use replace() to replace it with whatever you want
const const1 = "adios";
const const2 = "muchasgracias";
var result = const2.replace(const2.substring(0,5), const1);
console.log(result);
Source:stackexchange.com