Try this: $(function() { $('. Ajaxloader'). Click(function(event) { var target = $(this).
Attr('href'); window.location. Hash = target; $. Ajax({ url: target, success: function(data) { $('#conteudoInscricao') .
FadeOut('slow', function() { $(this). Html(data). FadeIn('slow'); }); } }); return false; }); }); So the effect will happen only after you have retrieved your data, avoiding any time gap to wait the data response.
1 You'll need to queue your .html() call. Right now, even though it is second in line, it will execute immediately. – user113716 Nov 26 '10 at 23:52 1 @dubrox - Good update.
Just a couple notes I'd make. First, inside the callback, you should use $(this) instead of doing a DOM selection with $('#conteudoInscricao'). Second thing is less important.
You can still place the .fadeIn() call where it was after the .fadeOut() because animations are automatically queued. May make it a little easier to read, though the outcome will be identical. :o) – user113716 Nov 27 '10 at 0:01 1 As AJAX calls are usually async, you can fire it at some point and obtain the data only after the server response is fully received.So the "success" callback will be called only some milliseconds after you made the AJAX call, during that time, if you fired other animations, those will run without waiting the data.
To wait the data before doing other stuff, simply put all those stuff inside the AJAX callback. Callbacks, in general, are used to assure that some actions will be run after a given event is completed. – dubrox 16 Nov7 at 0:13 1 @MEM - You've probably noticed that when you run an animation, your other javascript code continues to work.
In other words it doesn't freeze up. The reason is that while javascript typically executes in order, there are a few function calls that are taken out of the normal flow. These type of calls are used to create animations.
So if animations are removed from the normal flow of javascript, how can you execute something after an animation? The answer is that it needs to be taken care of manually. JQuery does this for you.
– user113716 Nov 27 '10 at 1:06 1 ...You pass the code that should execute after the animation as a callback argument. JQuery ensures that the function you passed will get called after the animation is complete. If you don't pass it as a callback, it executes immediately.
Why? Again, because animations are removed from the normal flow of javascript execution.So an animation doesn't prevent other javascript (like .html()) from executing. – user113716 Nov 27 '10 at 1:08.
At the moment it wont, because the fadeIn won't start until the fadeOut has finished!
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.