Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading large data in jquery

I have a web service that returns data, quite a large set, could be 600 rows, by 20 columns. What is the fastest most efficient way to load this data into an html table in Jquery code?

I tried creating the table html by looping through the data returned and creating a table DOM inside a string, but the looping part is very slow. I have heard of Jquery Templates, but I am not sure this technology is fast enough for large sets of data....

Thanks

like image 915
sarsnake Avatar asked Apr 10 '26 11:04

sarsnake


1 Answers

Is it possible for you to alter the web service or have another service call it and parse the data server side and return HTML? Processing the JSON on the client-side is going to be your bottleneck. If you can have the service return the required HTML to you, then it's a simple element.html(data) on the client side.

Edit: The question of returning JSON or HTML and the pros and cons of each have been discussed here quite a bit: 1, 2, 3, 4, 5

like image 193
v64 Avatar answered Apr 12 '26 00:04

v64



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!