Proyectos de Subversion Moodle

Rev

Rev 1 | Rev 362 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 361
Línea -... Línea 1...
-
 
1
import $ from "jquery";
Línea 1... Línea 2...
1
 
2
 
-
 
3
$(document).ready(function ($) {
-
 
4
  $(".btn-cesa-course-completion").click(function (e) {
Línea 2... Línea -...
2
$(document).ready(function( $ ) {
-
 
3
 
-
 
4
    $('.btn-cesa-course-completion').click(function(e) {
-
 
5
    	var url = $(this).data('url');
-
 
6
	 
-
 
7
		$.ajax({
-
 
8
			'dataType'  : 'json',
-
 
9
			'accept'    : 'application/json',
-
 
10
   			'method'    : 'get',
-
 
11
    		'url'       : url
-
 
12
		}).done(function(response) {
-
 
13
 			 if(response.success) {
-
 
14
   				window.location.href = response.data;
-
 
15
         	} else {
-
 
16
                alert(response.data);
-
 
17
            }
-
 
18
      	}).fail(function( jqXHR, textStatus, errorThrown) {
-
 
19
        	alert(response.data);
-
 
20
		});
-
 
21
	});
-
 
22
	
5
    var url = $(this).data("url");
-
 
6
 
-
 
7
    $.ajax({
-
 
8
      dataType: "json",
-
 
9
      accept: "application/json",
-
 
10
      method: "get",
-
 
11
      url: url,
-
 
12
    })
-
 
13
      .done(function (response) {
-
 
14
        if (response.success) {
-
 
15
          window.location.href = response.data;
-
 
16
        } else {
-
 
17
          alert(response.data);
-
 
18
        }
-
 
19
      })
-
 
20
      .fail(function (jqXHR, textStatus, errorThrown) {
-
 
21
        alert(response.data);
-
 
22
      });
-
 
23
  });