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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:34:05+00:00 2026-06-17T19:34:05+00:00

I have some informations in a form to send to the server as a

  • 0

I have some informations in a form to send to the server as a (complex) array (or Object if you prefer) with JS/jQuery. (jQuery 1.7.2)
I’m thinking about JSON to solve the problem smartly. My code works right now, but i want to know if its possible to do it better.

So this example is pretty typical (The data are more complex irl) :

dataSend = { 'id': '117462', 'univers': 'galerie', 'options' : { 'email': 'hello@world.com', 'commenataire': 'blabla', 'notation' : '4' } };

$.ajax({
  url: "/ajax/ajaxMavilleBox.php",
  data: JSON.stringify(dataSend),
  success: function(x){
      smth();
  }
});

In an another context, i have to make the exact same thing without JSON.

With the same example :

dataSend = { 'id': '117462', 'univers': 'galerie', 'options' : { 'email': 'hello@world.com', 'commenataire': 'blabla', 'notation' : '4' } };

$.ajax({
    url: "/ajax/ajaxBox.php",
    data: $.param(dataSend),
    success: function(x){
        smth();
    }
});

Obviously, I missing something.

The url is :

http://www.mywebsite.com/ajax/ajaxBox.php?id=117462&univers=galerie&options=%5Bobject+Object%5D

And the url should be :

http://www.mywebsite.com/ajax/ajaxBox.php?id=117462&univers=galerie&options[email]=hello@world.com&options[commenataire]=blabla&options[notation]=3

There is any easy way to do it (I hope I don’t have to edit the data myself in a loop or something)

Edit : Solution for the second part

Ok, the last part without JSON is correct. In fact, i was using an older version of jQuery in my page.
$.param is not so good with jQuery < 1.4

More information here Param Doc

  • 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-17T19:34:06+00:00Added an answer on June 17, 2026 at 7:34 pm

    as mentioned by @Johan POST shouldbe used here instead of GET
    you can view data you are sending by using the Developer options in the browser you are using just press f12
    also make sure you are using jquery >= 1.4
    the incorrect serialized string in the url is the way that $.param() used to serialize prior to 1.4 version

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

Sidebar

Related Questions

I have to loop in a JSON array to get some informations in node
I have a html form where visitors can fill and send me some information,
I have public site with some forms. Simple question: What kind of informations should
I have a LI with some information, including some links. I would like jQuery
I have to develop an application that display some information about the possessor of
I have a form, which gathers some Information of my visitor, and when they
I have a form with a text area field. I put some text information
So I Have a form that will send out emails that correspond to how
Here is what I'm trying to do: I have a normal form with some
I have a form in my application where technicians input information about different events

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.