mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-15 11:56:25 +00:00
31 lines
742 B
JavaScript
31 lines
742 B
JavaScript
$(document).ready(function() {
|
|
$(".run").click(function(e) {
|
|
e.preventDefault();
|
|
var id = $(this).data("gazelle-id");
|
|
var className = $(this).data("gazelle-class");
|
|
var methodName = $(this).data("gazelle-method");
|
|
|
|
var inputs = $("#method_params_" + id + " input");
|
|
|
|
var params = {};
|
|
$.each(inputs, function() {
|
|
params[this.name] = $(this).val();
|
|
});
|
|
|
|
$("#method_results_" + id).hide();
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "testing.php?action=ajax_run_method",
|
|
data : {
|
|
"auth": authkey,
|
|
"class": className,
|
|
"method": methodName,
|
|
"params" : JSON.stringify(params)
|
|
}
|
|
}).done(function(response) {
|
|
$("#method_results_" + id).html(response);
|
|
$("#method_results_" + id).show();
|
|
});
|
|
|
|
});
|
|
}); |