jquery - How find one msg to multi request response Ajax Data done -


hell send 3 request in ajax, webservice return me 3 success message show one.

exemple:

.done(function(shipdata) {   var ship = $(shipdata);   var msgerror = ship.filter('#alert');   if (msgerror == "invalid_shipto_town") {         $("#ship-modal-data p").append("code postal, ville destinataire est erronée.");             };    rum 3, show 1       code postal, ville destinataire est erronée.      code postal, ville destinataire est erronée.      code postal, ville destinataire est erronée. 

thank u helpe me

append add message ptag each response, added 3 times if 3 errors.

use text function overwrite p content instead , you'll have single message @ end:

$("#ship-modal-data p").text("code postal, ville destinataire est erronée."); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -