mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-30 07:59:40 -08:00
27 lines
526 B
JavaScript
27 lines
526 B
JavaScript
|
function submitQuery() {
|
||
|
var form = $("#queryForm");
|
||
|
|
||
|
$.ajax({
|
||
|
method: form.attr("method"),
|
||
|
url: form.attr("action"),
|
||
|
dataType: "html",
|
||
|
data: form.serialize(),
|
||
|
success: function(data, textStatus) {
|
||
|
$("#result").text(data);
|
||
|
},
|
||
|
error: function() {
|
||
|
alert("Error executing query!");
|
||
|
},
|
||
|
});
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
function bindHandlers() {
|
||
|
jQuery.ajaxSetup({
|
||
|
cache: false
|
||
|
});
|
||
|
$("#queryForm").submit(submitQuery);
|
||
|
}
|
||
|
|
||
|
$(bindHandlers);
|