Solved

request to iss from jquery

Posted on 2014-09-03
5
187 Views
Last Modified: 2014-09-04
I have page which has a grid section.
User can select one record from it and its details loads up in the details section

Now under details section information comes from three tables.
I am using Jquery ajax method to load the information in the form of json.

my question is, as I need information from three tables then
1. should I make one request and get the big bulky object in return.
2. should I make multiple request and get multiple response but smaller in sizes.
0
Comment
Question by:yadavdep
  • 2
  • 2
5 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 250 total points
ID: 40301016
Save server bandwidth and resoruces doing one request

{
    table1: [results request 1]
    table2: [results request 2]
    table3: [results request 3]
}

Open in new window

0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 250 total points
ID: 40301045
Depends on the size and type of the individual responses.

If the response size is relatively small (less than 100 KB) in total and response time is less than 10 sec, then one response is best.

However, if three individual queries on database you have fired are heavy/slow then it makes sense to call them one by one. You can show waiting indicator to manage the user experience or ensure that it is not too bad.
0
 

Author Comment

by:yadavdep
ID: 40302922
my problem is that in one of the table I have memo field and user can copy and paste any amount of data in it.
So the request size can vary.

but I also think doing a separate request would be better
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 40303212
<<my problem is that in one of the table I have memo field and user can copy and paste any amount of data in it.>>
In that case, unless you can stream data from your server, don't fetch everything in one go.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40303257
separate requests :
- slow dow, the proces
- consume bandwith
- slow down server (more request)

if you want to increase user experience choose another method
choosing a solution because it's easiest is not a right choice IMHO
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question