Testing AJAX

This is for me to text AJAX with jQuery.

by mazlix

HTML

<div id="button">
    Click here
</div>
<br />
<div style="border:dashed;height:80px;">
    <div id = "result" style="">
    Content gets loaded here
   </div>
</div>
<br>
<button id="show">show</button>

JavaScript

$.ajaxSetup({
    cache: false
});

var ajax_load = "<img src='http://dl.dropbox.com/u/4648153/ajax-loader.gif' alt='loading...' />";
var json1 = '{"name":"Jay Kru" ,"sex":"yes please"}';

show_json = function(responseText) {
    $("#result").html(responseText.name +"<br />" + responseText.sex);
};

function jog(){
    $('#result').html(ajax_load);
    $.post('/echo/json/', {json: json1, delay: 5}, show_json, 'json');
}
    
setTimeout(function(){jog()},1);