@Oskar

Thanks for the clear up vis-a-vis complete and success!

@Apprendista

You would have to use the success event to access the response
manually, something like:

onSuccess: function(tree, elements, html) {
    $('ajax').set('html',html).fade('in');
  }
}

Or maybe something like:

onSuccess: function(tree, elements, html) {
    $('ajax').empty().grab(tree).fade('in');
  }
}

might also work, but I'm not sure (I have a vague memory I have had
problems using the response tree, but I might be making that up).

Michal.

On Oct 26, 5:48 pm, ApprendistaStregone
<[EMAIL PROTECTED]> wrote:
> Hello and thank you for you replies
>
> I'm new on mootools and I'm not a javascript coder either!
> I'm sure my code is shoddy and classes would be one of the many
> optimizations I should implement. I have to learn how to do it and the
> find some spare time!
>
> Regarding onSuccess or OnComplete I suppose I want onComplete because
> I want the div do fade in anyway.
> Unfortunately I don't know how to inject the response manually. What I
> find strange is that i wasn't able to find any tutorial or any code
> snippet to do such a simple and common thing: fade out -> update div -> fade 
> in.... maybe I'm missing something or I'm doing it the wrong
>
> way!
>
> On 24 Ott, 10:08, Oskar Krawczyk <[EMAIL PROTECTED]> wrote:
>
> > @Michal, just to clear things up on the onComplete/onSuccess subject:
>
> > onSuccess fires when the response/event is executed successfully – no
> > surprise there.
> > onComplete fires when – both – onSuccess and onFailure are triggered.
>
> > Best,
> > Oskar
>
> > On Oct 23, 9:49 pm, Michal <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
>
> > > I'm not sure, but I would investigate a few things:
>
> > > - Maybe use onSuccess instead of onComplete? (I'm not sure of the
> > > differences though)
> > > - Maybe injecting the response html manually into 'ajax' instead of
> > > using the 'update' option. Maybe 'update' doesn't work well with
> > > fading with onComplete/Success?
>
> > > And although not directly related to your problem, I would suggest to
> > > maybe make a small class for your request/fading code? This should cut
> > > down on repeated code and and make it easier to update/debug in the
> > > future.
>
> > > Michal.
>
> > > On Oct 23, 1:23 pm, ApprendistaStregone
>
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hello,
> > > > I recently "discovered" mootools and used it in a new site
>
> > > >http://www.areatel.it/
>
> > > > the problem is that everything works fine in firefox / safari / chrome
> > > > etc... but not in IE7!
>
> > > > it's very simple
>
> > > > HTML
>
> > > > -- HEADER STUFF--
>
> > > > <div id="ajax"> here goes the main content </div>
>
> > > > -- FOOTER STUFF --
>
> > > > when you click a link in the navbar javascript fades out ajax div,
> > > > call via remote.html the actual content of the div and then fades it
> > > > in again.
>
> > > > You can see the code herehttp://pastie.org/298833
>
> > > > So the effect works fine on every browser I tried but Internet
> > > > Explorer 7..... someone knows why??
>
> > > > Thank you very much!

Reply via email to