Can You tell me what's wrong with this JS code:

var searchUpdater;
updateSearch = function() {
        if ($F("searchField").length >= 3) {
                if (searchUpdater)
                        searchUpdater.suspend=true;
                searchUpdater = new Ajax.Request('/ajax_search.php', {
                        method: 'get',
                        onComplete: function(response) {
                                Element.hide('search_spinner');
                                if (!this.suspend)
                                        
$('content').update(response.responseText);
                        },
                        onLoading: function(request)
                                {Element.show('search_spinner')},
                        parameters: { searchText: $F("searchField") }
                });
        }
}

It should suspend the previous request from updating 'content' div,
but it does not.
--~--~---------~--~----~------------~-------~--~----~
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