|
Too many AJAX calls? -- MPiccinato --
Hello, I am having an issue where my javascript variables seem to be getting all out of whack when I do multiple AJAX calls. The exacit issue is that 'FormID' is not always the correct value when it is referencing itself. Sometimes it is 'pnlSales' when it should be 'pnlManufacturing'. Here is my code // Fills In all forms, called on Body Load function fillPage() { fillForms('pnlEngineering', getECP()) fillForms('pnlSales', getECP()); fillForms('pnlManufacturing', getECP()); } function fillForms(FormID, ECP) { // Display loader loader('show', 'Loading...'); // Each table has the same first 5 rows columnOffSet = 5; currency = 4; tableName = ''; // Determine which table to go to switch(FormID) { case 'pnlEngineering': tableName = 'tc_EngInput'; break; case 'pnlSales': tableName = 'tc_SalesInput'; case 'pnlManufacturing': tableName = 'tc_Manufacturing'; break; } TestApp.TargetCosting.returnForm(ECP, tableName, function(res) { if(res.value != null) { // Gets all the Elements in FormID that are inputs var TextInputs = document.getElementById(FormID).getElementsByTagName('input'); }); return false; } Thanks for any help in advance, Mat |
|
-- MPiccinato --
Nevermind =D. After reading around some more I came across a post with the same problem...said something about using Fiddler. So I used Fiddler to see what was going on. A 'break' was missing from my switch statement =(. Ooooh thats funny. |