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

  • Home
  • SEARCH
  • 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 9115355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:24:42+00:00 2026-06-17T04:24:42+00:00

I wasnt quite sure how to ask this question, sorry.. but basically it’s this..

  • 0

I wasnt quite sure how to ask this question, sorry.. but basically it’s this..

I just started out w/ Ajax .. and with sending XMLhttpRequest in the background, i’m having problems w/ some html special characters in the form data , specially the & sign terminating the variable prematurely

eg. value “You & I” results to “You ”

Now to explain this question from my perspective.. it’s simply this.. if i submit my regular form using GET method, the same thing happens.. since the variables are URL-Encoded.. but if i set the form to POST method then everything is PRESERVED as i needed it..

Now I believe it has something to do w/ this (?)

hr.open("POST", link, true);
hr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

particularly on the form-urlencoded part.. is there an alternative?

i’d hate to have to run a cleanup routine on each variable that i pass thru Ajax 🙁

  • 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-17T04:24:43+00:00Added an answer on June 17, 2026 at 4:24 am

    the & sign terminating the variable prematurely

    & is supposed to terminate values in x-www-form-urlencoded data. You need to encode your data when building URLs.

    if i submit my regular form using GET method, the same thing happens.. since the variables are URL-Encoded

    No. If you submit a regular form using GET, then the inputed data will be URL Encoded and ampersand characters that appear as data will be represented by %26 and not as raw & characters so the same thing won’t happen.

    is there an alternative [to application/x-www-form-urlencoded]?

    You can use any data format you like. Some are easier to generate than others (JSON is particularly easy to generate from a browser). You then have the challenge of decoding them on the server (form handling libraries don’t tend to do JSON, so you’d have to get the raw POST data and decode it yourself).

    Since your actual problem is solved by encoding your data, this is unnecessary.

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

Sidebar

Related Questions

I wasnt quite sure how to word the question correctly - but this is
I'm not quite sure how to ask this question. What I'm trying to do
I'm not quite sure if I can ask this question here or on SuperUser
This is a bit of a silly question (probably) but I wasn't quite sure
Hello I wasn't quite sure how to title this question, but I'll explain why
i am sure this is quite a numb question to ask and most probably
Wasn't quite sure how to word this but let's say I've used ssh to
Im quite annoyed at having to ask this but I cant get it to
I'm not quite sure how to approach this so thought it best to ask,
I want to try out heroku, but am not quite sure if I understand

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.