title: message success in ajax post
body: <p>I have a code that sends a series of posts at the time of clicking a button, several posts are sent at the same time, for each post I show a success message (alert). Is there a way to limit the success messages to 1 ?, for example if 4 posts are sent, that only an alert is sent to the HTML page, is there a way to do this?</p>
  <p><strong>This is my code:</strong></p>
  <pre><code>$('#save').on('click', function () {
  
          $(&quot;.draggable&quot;).each(function () {
              var elem = $(this),
                  id = elem.attr('id'),
                  pos = elem.position(),
                  left = pos.left,
                  top = pos.top;
  
              $.ajax({
                  method: &quot;POST&quot;,
                  url: &quot;{% url 'update-positions-device' %}&quot;,
                  headers: {'X-CSRFToken': '{{ csrf_token }}'},
                  data: {idd: id, left: left, top: top},
                  success: function (response) {
                      alert(&quot;Sending data positions&quot;);
                  },
                  complete: function () {
                  },
                  error: function (xhr, textStatus, thrownError) {
                      alert(&quot;The data could not be sent&quot;);
                  }
              })
  
          })
  
      })
  </code></pre>