auth.js 743 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. $('#auth').ajaxForm({
  2. dataType: 'json',
  3. success: function(data)
  4. {
  5. $.each(data, function(i, val)
  6. {
  7. if(i == 'e')
  8. {
  9. bootbox.dialog('<h3 class="red">Ошибка</h3>'+val,
  10. [{
  11. "label" : "Продолжить",
  12. }]
  13. );
  14. document.getElementById("captcha_img").src = home+'auth/captcha?'+Math.random();
  15. $('#captcha').val('');
  16. }
  17. if(i == 'i')
  18. {
  19. bootbox.dialog('<h3 class="blue">Внимание</h3>'+val,
  20. [{
  21. "label" : "Продолжить",
  22. }]
  23. );
  24. $('#security_code').css('display', 'table-row');
  25. document.getElementById("captcha_img").src = home+'auth/captcha?'+Math.random();
  26. $('#captcha').val('');
  27. }
  28. if(i == 's')
  29. location.reload();
  30. });
  31. }
  32. });