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 8218343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:45:42+00:00 2026-06-07T12:45:42+00:00

i am building a query string for my url and need to exclude certain

  • 0

i am building a query string for my url and need to exclude certain chars from the encode.

I want to exclude the “&” and the “=” so that I can make a statement as such:

first=blah&second=blah and so on….

I guess the best way to put it is how do I stop them from being encoded?

some code:

 else if (array[i].nodeName == "SELECT") {
   if (array[i].id == "multiple") {
     var selected = $.map($('#multiple option:selected'),

     function (e) {
       return $(e).val();
     });
     $.each(selected, function (index, value) {
       name = array[i].name;
       values += app + "\&" + key + "=";
     });

   } else {
     name = arr[i].name;
     values = arr[i].value;
   }
 }

 key = encodeURIComponent(name);
 value = encodeURIComponent(values);
 queryString += name + "=" + values + "&";
  • 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-07T12:45:43+00:00Added an answer on June 7, 2026 at 12:45 pm

    Is there a way to exclude certain chars from encodeURIComponent?

    No. It’s a builtin function that takes exactly one argument.


    You do need to encode & when it appears in the middle of a key or value so the simplest solution is to encode the individual names and values before combining them. Define

    function emit(name, value) {
      queryString += (queryString.indexOf("?") >= 0 ? "&" : "?")
        + encodeURIComponent(name) + "=" + encodeURIComponent(value);
    }
    

    and then call that function for each name/value pair in multiple selects or once for each other checked input.

    else if (array[i].nodeName=="SELECT" ){
      if(array[i].id == "multiple"){
        var selected = $.map( $('#multiple option:selected'),
                              function(e){return $(e).val();});
        $.each(selected, function(index, value){
                 emit(array[i].name, value);
               });
      } else {
        emit(arr[i].name, arr[i].value);
      }
    }
    

    Using encodeURI or similar will not properly encode #, = or other necessary code-points.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a query to gather data from multiple tables. I want to
I'm having trouble building a query. I can do what I want in 3
I need to use a string query to make a DB search for a
The below example shows how I'm building the query string that will return a
In my base page I need to remove an item from the query string
using a c# asp.net page, building a SQL query string to run against an
I am having some trouble building the query I need to return the AccountID
A friend asked me for help on building a query that would show how
In sql 2005, instead of building a query from dateparts year, month and date,
I'm building a LINQ query dynamically based on user input, and I want to

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.