All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.internal.js.triggerButton.js Maven / Gradle / Ivy

The newest version!
$('.triggerButton').on('click', function () {
    $.ajax({
        type: "POST",
        url: $(this).data("trigger-url"),
        data: {},
        dataType: "json",
        error: function(data, status, error){
            if (error === 'Conflict') {
                alert("Job is currently running or blocked by a different job.")
            } else {
                alert("Failed to trigger job. \n\nStatus: " + status + "\nError: " + error);
            }
        },
        success: function(data, textStatus, xhr) {
            // data.redirect contains the string URL to redirect to
            window.location.href = xhr.getResponseHeader("Location");
        }
    });
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy