[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/jscripts/ -> question.js (source)

   1  var question = {
   2      refresh: function()
   3      {
   4          var question_id = $('#question_id').val();
   5  
   6          $.ajax(
   7          {
   8              url: 'xmlhttp.php?action=refresh_question&question_id='+question_id,
   9              method: 'get',
  10              dataType: 'json',
  11              complete: function (request)
  12              {
  13                  question.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.question_fetch_failure + ' ' + message, {theme:'jgrowl_error'});
  28              });
  29          }
  30          else if(json.question && json.sid)
  31          {
  32              $("#question").html(json.question);
  33              $("#question_id").val(json.sid);
  34          }
  35  
  36          $('#answer').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