I know the following code would show a loading image when a button is clicked on the page:
$.ajaxSetup ({
cache: false
});
var ajax_load = "<img src='img/load.gif' alt='loading...' />";
var loadUrl = "ajax/load.php";
$("#load_basic").click(function(){
$("#result").html(ajax_load).load(loadUrl);
});
but what if I want this to happen soon as the page loads. I dont want the user interaction of clicking a button to make the ajax call.
Throw it inside the document ready function: