Listing 1. A simple jQuery example, showing how to process events, access
the
page and use AJAX.

var myButtonId = "#processButton");
$(myButtonId).click(function(e) {                // when clicked...
    $(myButtonId).attr("disabled", "disabled");  // disable button
    $.get("my/own/services", function(data) {    // call server service
        window.alert("This came back: " + data); // show what it returns
        $(myButtonId).removeAttr("disabled");    // re-enable the button
    }
});