loading multiple <DIV>s with content - some dont load at all
I've got a series of <DIV>s to contain report data (<TABLE>s), followed by the script to load each <DIV>. Each table generation is 5 to 30 seconds, so I was trying to get all the reports in parallel, rather than sequential calls. Some of the tables get loaded, but others never do, even though I can see the server is generating the html to return to the client. Am I running into a limit in javascript or maybe an error on some of the table results that wont load the result?
Can I attach an error handler to each .html replacement call to tell me if it fails?
- <div id="divNPT" class="rptTable">Loading table for NPT blend. Please wait...</div>
- <div id="divNPT M G 100" class="rptTable">Loading table for NPT M G 100 blend. Please wait...</div>
- <div id="divNPT M B" class="rptTable">Loading table for NPT M B blend. Please wait...</div>
- <div id="divMAV MG" class="rptTable">Loading table for MAV MG blend. Please wait...</div>
- <div id="divMAV" class="rptTable">Loading table for MAV blend. Please wait...</div>
- <div id="divOGD G" class="rptTable">Loading table for OGD G blend. Please wait...</div>
- <div id="divTRU" class="rptTable">Loading table for TRU blend. Please wait...</div>
- <div id="divKNT III" class="rptTable">Loading table for KNT III blend. Please wait...</div>
- <div id="divKNT" class="rptTable">Loading table for KNT blend. Please wait...</div>
- <script type='text/javascript'>
- // get table for 'NPT' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'NPT'},
- function (data) {
- $('#divNPT').html(data);
- }
- );
- // get table for 'NPT M G 100' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'NPT M G 100'},
- function (data) {
- $('#divNPT M G 100').html(data);
- }
- );
- // get table for 'NPT M B' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'NPT M B'},
- function (data) {
- $('#divNPT M B').html(data);
- }
- );
- // get table for 'MAV MG' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'MAV MG'},
- function (data) {
- $('#divMAV MG').html(data);
- }
- );
- // get table for 'MAV' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'MAV'},
- function (data) {
- $('#divMAV').html(data);
- }
- );
- // get table for 'OGD G' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'OGD G'},
- function (data) {
- $('#divOGD G').html(data);
- }
- );
- // get table for 'TRU' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'TRU'},
- function (data) {
- $('#divTRU').html(data);
- }
- );
- // get table for 'KNT III' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'KNT III'},
- function (data) {
- $('#divKNT III').html(data);
- }
- );
- // get table for 'KNT' blend
- $.get('/Substitution/GetTableForBlend',
- { "snapShotId": 1, "blend": 'KNT'},
- function (data) {
- $('#divKNT').html(data);
- }
- );
- </script>