tags:

views:

23

answers:

2

i want to call two function automaticaaly when that page loaded. how to do it with jquery

suppose my funtion is getData();

how do i intitiate  this via jQuery
A: 
$(function(){
    getData();
});

See Introducing $(document).ready()

$(function() 

is a shorthand for

$(document).ready(function()

rahul
okay now i m going to do something with jquery.get method.i want to show progress bar during response from server? how to do that sir?
diEcho
You can check this one. http://www.djangosnippets.org/snippets/679/
rahul
not this dear? i want to show ant loading gif during the function done his task
diEcho
A: 

JQuery way

$(function(){

getData1();//first function

getData2();//second function

});

$(document).ready(function(){

            getData1();
            getData2();

});

javascript way

Ravia