[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/jscripts/ -> captcha.js (source)

   1  var captcha = {
   2      refresh: function()
   3      {
   4          var imagehash_value = $('#imagehash').val();
   5  
   6          $.ajax(
   7          {
   8              url: 'xmlhttp.php?action=refresh_captcha&imagehash='+imagehash_value,
   9              method: 'get',
  10              dataType: 'json',
  11              complete: function (request)
  12              {
  13                  captcha.refresh_complete(request);
  14              }
  15          });
  16  
  17          return false;
  18      },
  19  
  20      refresh_complete: function(request)
  21      {
  22          var json = JSON.parse(request.responseText);
  23          if(json.hasOwnProperty("errors"))
  24          {
  25              $.each(json.errors, function(i, message)
  26              {
  27                  $.jGrowl(lang.captcha_fetch_failure + ' ' + message, {theme:'jgrowl_error'});
  28              });
  29          }
  30          else if(json.imagehash)
  31          {
  32              $("#captcha_img").attr("src", "captcha.php?action=regimage&imagehash=" + json.imagehash);
  33              $('#imagehash').val(json.imagehash);
  34          }
  35  
  36          $('#imagestring').removeClass('error valid').val('').prop('aria-invalid', null).removeData('previousValue')
  37                          .next('label').remove();
  38      }
  39  };


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref