Request.JSONP
HTML
<div class='wrapper'>
<p class="click">CLICK ME</p>
<div id='post'></div>
</div>
CSS
.click
{
color: blue;
text-decoration: underline;
}
.loaded
{
background-color: red;
display: none;
}
JavaScript
$('.click').click(function(){
$.ajax({
type: 'POST',
url: '/echo/html/',
data: { html: "<p class='loaded'>hello ajax!<br/>hello ajax!<br/>hello ajax!<br/>hello ajax!</p>"},
success: function(data) {
$('#post').html(data);
$('.loaded').slideDown();
}
});
});