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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:10:28+00:00 2026-06-03T01:10:28+00:00

If I have an object array like this… var p = [{ ‘first’: ‘John’,

  • 0

If I have an object array like this…

var p = [{ 'first': 'John', 'last': 'Doe' }, { 'first': 'Sue', 'last': 'Smith' }];

And I need to append it to the URL like this…

/myapp/myaction?p[0].first=John&p[0].last=Doe&p[1].first=Sue&p[1].last=Smith

Is there something in JQuery that will help me do this without having to process it manually?

Basically, I have an object like the people array, and I need to send it to ASP MVC3 in a format that it will understand and bind to a list. MVC3 understands nested items encoded in the “dot” format (e.g. p[0].first).

  • 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-03T01:10:29+00:00Added an answer on June 3, 2026 at 1:10 am

    There may be an even better way, but something like this should work:

    var params = $.map(p, function(n, i){
        return "p[" + i + "].first=" + n.first + "&p[" + i + "].last=" + n.last;
    }).join("&");
    

    If the properties of the objects are dynamic, you could use a for...in to loop over them.

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

Sidebar

Related Questions

If I have a javascript object/assoc. array defined like this: function somefunction(options) { var
I have an array like this: object[] args and need to insert those args
I have converted an array to object data like this: <?php $myobject->data = (object)Array('zero','one','two');
I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]
I have a map array with objects stuffed with variables looking like this: var
I have an array like this (below is the var_dump) array 0 => object(stdClass)[11]
I have a multidimensional array like this : $products Smarty_Variable Object (3) ->value =
If I have an array like this: var arr = ['one','two','three']; I can access
I have an objects array like this: Array ( [945] => member Object (
I have an object whose value may be one of several array types like

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.