I won't critique your PHP, but most all asynchronous scriptaculous or
prototype calls have a set of callback hooks.  You'll need to look in
the documentation for the specifics since the naming isn't consistent,
but for example you could do:

new Effect.Appear(element, {
        afterFinish: function(el) {
                // This is executed after the effect has done its stuff
        }
});

See http://wiki.script.aculo.us/scriptaculous/show/CoreEffects for more.

Similarly you could do the Ajax stuff first and use the onComplete or
onSuccess callbacks to then invoke the effect.

On 5/17/07, envex <[EMAIL PROTECTED]> wrote:
>
> Hey,
>
> I'm brand new to AJAX and scriptalicious, so i'm hoping for some help.
>
> inside hello.php
>
> I have this piece of code to grab and loop out users in the database:
>
> function test(){
>      $query = mysql_query('SELECT * FROM `testing`');
>
>      while($i = mysql_fetch_row($query))
>      {
>          echo'<div class="testie">';
>          echo $i[0] . "<br />";
>          echo $i[1] . "<br />";
>          echo $i[2] . "<br />";
>          echo '<a href="javascript: MyAjaxRequest(\'main\',\'hello.php?
> ID=' . $i[2] .'\')">Delete</a><br />';
>          echo '</div>';
>     }
> }
>
> This piece of code deletes the user from the database if chosen, and
> then re-generates the list via AJAX:
>
> if($_GET[ID] == "")
> {
>     echo "nothing";
> }else{
>     $delete = mysql_query('DELETE FROM `testing` WHERE ID = ' .
> $_GET[ID] . '');
>     echo "Item has been deleted";
>     test();
> }
>
> Now comes the problem, how would i make the delete div use the
> scriptalcious fade effect to fade out, then execute the AJAX function
> to delete the user?
>
> Any help is greatly appreciated!
>
> Thanks,
>
> envex
>
>
> >
>


-- 
Jesse E.I. Farmer
e: [EMAIL PROTECTED]
w: http://20bits.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to