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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:11:39+00:00 2026-06-15T22:11:39+00:00

Im using a proxy to get Bing search results, based on the value of

  • 0

Im using a proxy to get Bing search results, based on the value of some input.

    var query =  $('input').val();

    var url = 'http://www.bing.com/search?q=' + query + '';
...rest of code...

It works good except in case of more than one word seperated with space, for instance this will not work: “cars for sale” Because here we have 3 words and they need to be seperated in the url with either “+” or with “%20”
So the actual url will look like this:

http://www.bing.com/search?q=cars+for+sale+

So how do I get the var url to distinguish when it comes to spaces in the input value?

ps The query does not necessarily have to be in input, it can also be plain text in some div

  • 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-15T22:11:41+00:00Added an answer on June 15, 2026 at 10:11 pm

    Use encodeURIComponent. It is the general solution to the “I want to add user input to a URI” problem.

    var url = 'http://www.bing.com/search?q=' + encodeURIComponent(query);
    

    This will handle your specific problem as well as issues such as the data entered containing an & character.

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

Sidebar

Related Questions

For some reason I can get this to work, using single proxy everything seems
I'm using a proxy to get google results. Which I then show as plain
I'm using Charles Proxy for http debugging. For switching http method GET to POST,
I'm using tornado to fetch many web pages asyncroniously using HTTP proxy . So,
I am using node-http-proxy . However, in addition to relaying HTTP requests, I also
I need get the IP address for the user cross the proxy using PHP...
I try to the get source of a page using file_get_contents() via proxy using
I can get here, but no one at work using our proxy can seem
I'm trying to figure out how make a basic GET request using Network.HTTP.simpleHTTP that
I want to connect URL via proxy server but when I am using proxy

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.