Skip to content

Category: Questions

Vue JS – Using URLSearchParams is showing me error

I have an object and I need to pass it to the ajax request. Here thissearchString is an array of object. I need to pass this array of object to the URL. So, I am using URLSearchParams but got this error message: Answer I think you not understand the function of URLSearchParams. Here, what this function do: Wi…

Divide array to group indexes

I have a problem with the following logic in Javascript. I have the following array, that have dynamic number of indexes, in this example I write one array with 2 indexes. [[S,Blue],[M,Red],[L,Yellow] I want to have this structure: { 0: [S,M,L], 1: [Blue,Red,Yellow] } The numbers are the indexes of first grou…

NextJs doesn’t rerun scripts

When I use the <Link> tag in NextJs to navigate between pages it doesn’t rerun my scripts after changing pages. It only runs the scripts after the first page load or when I press reload. When using plain <a> tags instead, it works fine because the page reloads after each navigation. As far a…