jQuery sa AJAX-om

Primer:

HTML:
<div id='load'>
    Kliknite ovde 
    kako bi preuzeli podatke
    <div id="dugme" style="width:50px">
        <img src="btn.png"/>
    </div>
</div>
<div id='rezultat'></div>
<div id='error'></div>
<div id='help'></div> 
jQuery:
$( "#dugme" ).click(function( event ) {
    event.preventDefault();
    $("#help").load("test.html", function (response, status, xhr) {
        if (status == "error") {
            var msg = "Greška prilikom slanja";
            $("#error").html(msg + xhr.status + " " + xhr.statusText);
        } else{
            $('#rezultat').append($('#help').html());
            $('#help').empty();
        }
    }); 
});
Kliknite ovde kako bi preuzeli podatke