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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:41:19+00:00 2026-05-18T12:41:19+00:00

The Good: We send a JSON array of nested objects using JQuery and .ajax().

  • 0

The Good:

We send a JSON array of nested objects using JQuery and .ajax(). We use JQuery and Microsoft templates to render the content. It sends 100 objects in 400 ms. This is so much faster than our equivalent server rendering of 50 products in 10 seconds.

The Difficulty:

We need to bind a JavaScript object array to the DOM html elements it represents, i.e., changes to the html input will reflect back to the JavaScript object. Our difficulty is that our objects are nested, and only contain selected options:

Product[].Department[].deptid;
// We only store the departments for which this product participates

We tried Microsoft data linking using JQuery, which requires both object properties and html elements to exist in order to bind them together. That doesn’t do well for the above situation. We could do this:

Product[].Department[].Dept.id;
Product[].Department[].Dept.name;
Product[].Department[].Dept.selected;  // true if selected, false if not
// This requires all possible options in all needed products.  Yuck

Are there any examples out there on how best to handle binding a JavaScript nested object array to the HTML elements they represent?

We don’t submit form elements back to the server. Instead we collect them in to a JSON array and send that back to the server. It works extremely fast, but assembly is tedious.

  • 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-18T12:41:20+00:00Added an answer on May 18, 2026 at 12:41 pm

    It’s hard to know exactly what you’re having trouble with from your description, but it seems like there are two things that might help:

    1) You can store data on a dom element using jQuery’s data() method http://api.jquery.com/data/

    2) You can get the value of a form element using the change() event and the val() method. (You can also find those in the API docs.)

    But it seems like you could be running into something more basic, like the question of how to know which Javascript object goes with with form element. Is that the case?

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

Sidebar

Related Questions

I built contact form in aspx 3.5 and I'm using jQuery to send it
I'm familiar enough with Ajax and JSON that I can send a request and
I am using Zend Framework. My task is to send JSON data from controller
i want to send a json string from a html webpage using javascript to
How can I send an email from C++? Is there a good cross-platform (MS
In my web app, I have some complex objects written with JavaScript (ie nested
I am planning to send Javascript array object filled with data by encoding it
any good library to send POST headers in ruby ?
Are there good references teaching you how to send PUT/DELETE/POST/GET with ruby? I have
Good morning guys Is there a good way to use regular expression in C#

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.