Proyectos de Subversion Moodle

Rev

Rev 1 | Rev 362 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |

import $ from "jquery";

$(document).ready(function ($) {
  $(".btn-cesa-course-completion").click(function (e) {
    var url = $(this).data("url");

    $.ajax({
      dataType: "json",
      accept: "application/json",
      method: "get",
      url: url,
    })
      .done(function (response) {
        if (response.success) {
          window.location.href = response.data;
        } else {
          alert(response.data);
        }
      })
      .fail(function (jqXHR, textStatus, errorThrown) {
        alert(response.data);
      });
  });
});