Solved

request to iss from jquery

Posted on 2014-09-03
5
183 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
<<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
Comment Utility
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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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)

771 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

10 Experts available now in Live!

Get 1:1 Help Now