javascript - How dsiplay alert message after saving data using Jquery -


actually got alert message display before saving data please me out

below code there

      (var = 0; < rows_count; i++) {                 var count = 0;                 $.ajax({                     type: "post", url: "default.aspx/update_extrahoursworked", cache: false, data: "{'empid':'" + $("#emp_id" + i).text() + "','emp_code': '" + $("#emp_code" + i).text() + "','emp_category':'" + $("#emp_category" + i).text() + "','g1': '" + $("#txtgen_three" + i).val() + "','f1': '" + $("#txtfirst_three" + i).val() + "','s1': '" + $("#txtsecond_three" + i).val() + "','t1': '" + $("#txtthrid_three" + i).val() + "','g2': '" + $("#txtgen_four" + i).val() + "','f2': '" + $("#txtfirst_four" + i).val() + "','s2': '" + $("#txtsecond_four" + i).val() + "','t2': '" + $("#txtthrid_four" + i).val() + "','g3': '" + $("#txtgen_five" + i).val() + "','f3': '" + $("#txtfirst_five" + i).val() + "','s3': '" + $("#txtsecond_five" + i).val() + "','t3': '" + $("#txtthrid_five" + i).val() + "','contracortname': '" + $('#ddlcontractornames>option:selected').text() + "'}", contenttype: "application/json; charset=utf-8", datatype: "json",                     success: function (data) {  }, error: function (e) { alert('error, update att.'); }                  });             } enablelasttwodays(true);                  alert('saved successfully');           } 

you can count every success , alert ..

count_success= 0; (var = 0; < rows_count; i++) {                     //---                     //--                         success: function (data) { count_success++; },                         error: function (e) { alert('error, update att.'); }                      });                 } enablelasttwodays(true);                      alert(count_success +'record saved successfully');               } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -