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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:17:21+00:00 2026-05-13T07:17:21+00:00

I have a lot of JSON data I need to pass to a request:

  • 0

I have a lot of JSON data I need to pass to a request:

$.ajax({
                type: "POST",
                url: "http://"+HOST+"/users/rankings",
                data: "friends="+JSON.stringify(friendsArr),
                success: function(response){
                    $("#rankings").html(response);
                }
            });

friendsArr is an array of objects in JSON format. The issue is that some objects have data with a “+” and that does not get encoded properly. It comes in server side as a ” ” and the data is messed up. Do I really have to iterate through all the data and encode each value separately? There must be an easier way.

  • 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-05-13T07:17:21+00:00Added an answer on May 13, 2026 at 7:17 am

    I would try it using the $.post method vs. the raw $.ajax one, and let jQuery handle the work for you:

    $.post( "http://"+HOST+"/users/rankings",
        { friends: JSON.stringify(friendsArr) },
        function(data){
            $("#rankings").html(response);
      }
    );
    

    Additionally, since you can only POST via AJAX to addresses on the same domain, why not just use "/users/rankings" as your URL vs. "http://"+HOST+"/users/rankings"

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

Sidebar

Related Questions

I have a need to bulkInsert a lot of data I'm using a content
I have data that I convert to JSON. I need storage to be very
I have a JSON file with a lot of unneeded data and I wish
I have a lot of JSON data which is organized in nested lists. Each
I have a large JSON file that contains A LOT of similar code. It's
I am creating Excel file download using NOPI libraries. I have lot of data
I am trying to build a data mart. I have lot of dimensions, and
I am building a Railo app which deals with a lot of JSON data
I have implemented an Ajax request on my website, and I am calling the
I get some json data, and there I have such a structure: 'modules' :

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.