Solved

request to iss from jquery

Posted on 2014-09-03
5
184 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now