tags:

views:

1008

answers:

2

Here is my code:

Event.observe(window, 'load', function() {  
        Event.observe('form_post', 'submit', function(){
            new Ajax.Updater('Posts', 'getPosts.php', {
            });
        });
});

I just want to delay the call to Updater, any ideas??

Thanks

+1  A: 

Wrap it in a setTimeout call.

ceejayoz
I second that. Not everything needs a fancy prototypejs function :-)
Jarret Hardie
+2  A: 

Use the prototype delay method.

Event.observe(window, 'load', function() {  
        Event.observe('form_post', 'submit', function(){
            new Ajax.Updater.delay(1, 'Posts', 'getPosts.php', {
            });
        });
});
tj111
I was just typing the same thing. Good call
Pablo Fernandez