On Jan 8, 2008 12:38 PM, rics <[EMAIL PROTECTED]> wrote:

>
> Hello people,
>
> How can I force some code to run only when the execution of other
> function finish? Look my code:
>
>
>        function loading() {
>                $("#ajaxContent").slideToggle("normal", function() {
>                        $("#ajaxLoader").toggle();
>                });
>        }
>
>
>        $("#searchBar > button").click(function() {
>                loading();
>                $.get("ajax/list.php", function(data){
>                        $("#ajaxContent").html(data);
>                        loading();
>                });
>        });
>
>
> In the second block of code I want the $.get to execute only when the
> function loading(), that was coded by me, finish to execute. I mean,
> when the #ajaxLoader is show up.
>
> How can I do something like that?
>
If I'm getting right... ur results display before ur "loading" image even
appear...
If that so... you could use a timer with a constant delay 'cuse u really
don't know how long it takes to the browsers shows ur "loading" display...



-- 
Innovation the most beautiful Imagination's result

Reply via email to