Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8747841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:25:26+00:00 2026-06-13T12:25:26+00:00

I apologize in advance for not being able to supply more information, if this

  • 0

I apologize in advance for not being able to supply more information, if this is not possible with the limited info, I will delete the question.

So, I have a script that generates kind of a search engine that depends on the script (also dinamically generated) which is quite complicated and I don’t have any impact on it.

When you click on the apply (search) button, the search process is triggered and you can see the results on the new URL that has a few parameters.

E. g.: http://www..example.com/...&ThisParameter=XYZ&SecondParameter=foo&ThirdParameter=bar

My question is – is it possible to change "ThisParameter=XYZ" to something else, e. g. "ThisParameter=Something".

The problem is that I don’t know how the URL is constructed and can’i impact it, so I would need a code that would just take any URL generated and change this part mentioned.

Thank you for your opinions in advance!

EDIT

I have found the part of the script that impacts the URL generated. When I change it in DOM, it does redirect me to the desired page.

var options = {"FOO":123,"BAR":"ABC","ThisParameter":"STH","EXAMPLE":123, ...}

And this is the output when you choose “copy path”:

_options[0].ThisParameter
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:25:27+00:00Added an answer on June 13, 2026 at 12:25 pm

    IF THE SEQUENCE OF QUERY PARAMETERS ARE ALWAYS THE SAME:

    var url = window.location.href;
    var lst_temp = url.split('?');
    var $lst_parts = lst_temp[1].split('&');
    
    var new_val = 'blabla';
    var position = 'x';
    lst_parts[x] = 'ThisParameter=' + new_val;
    
    var url_new = lst_temp[0] + '?';
    url_new += lst_parts.join('&');
    

    EDIT:
    IF ORDERING OF QUERY KEYS ARE NOT KNOWN BEFORE HAND, DO THIS:

    Use this function from here: https://stackoverflow.com/a/111545/888177

    function EncodeQueryData(arr_data) {
       var ret = [];
       for (var d in arr_data)
          ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(arr_data[d]));
       return ret.join("&");
    }
    

    Then read the url and split it like this:

    var url = window.location.href;
    var key = "ThisParameter";
    var new_val = 'blabla';
    var lst_temp = url.split('?');
    var lst_parts = lst_temp[1].split('&');   
    

    Add this loop to create an associative array containing the query parameters and values:

    var arr_data = new Array();
    for (var index in lst_parts) {
       lst = lst_parts[index].split('=');
       arr_data[lst[0]] = lst[1];
    }
    

    To avoid endless refresh:

    var val = arr_data[key];
    if (val != new_val) {
      arr_data[key] = new_val;
      var  new_url = lst_temp[0] + '?' + EncodeQueryData(arr_data);
      window.location.href = new_url;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologize in advance for not knowing how to better state this question. In
I'd like to apologize in advance, because this is not a very good question.
In advance, I apologize if the question title may not be be convenient. I'm
Info: Apologies in advance as im not sure if my explanation will be sufficient.
I apologize in advance, if this question doesn't make sense. I'm a newbie. I
I apologize in advance if this question seems confused. The behaviour I am seeing
I apologize in advance; this is a long question. I've tried to simplify as
this is likely to endup being an easy fix so I'll apologize in advance
I apologize in advance for the rambling nature of this question, but I have
First of all I apologize in advance for this question, a bit off the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.