I want to load the AJAX content when the submit button is pushed, not
when the page is loaded.  How do I do this?  It seems like this would
be a simple thing but I just can't get it to work.  I feel really dumb
for even asking but it's got me stumped.

I see that there's great examples about how to do the AJAX post event,
but no examples on how to call the function from an onClick event.

Listing 5. Complex Ajax made simple with $.ajax()
$.ajax({
    url: 'document.xml',
    type: 'GET',
    dataType: 'xml',
    timeout: 1000,
    error: function(){
        alert('Error loading XML document');
    },
    success: function(xml){
        // do something with xml
    }
});

Reply via email to