I can't think of any reason why you're seeing this. Can you post a complete
page that demonstrates this? You might be calling form_db() over and over
and not realizing it. Hard to tell.
On Wed, Jun 4, 2008 at 4:37 AM, sheps-ii <[EMAIL PROTECTED]>
wrote:
>
> Hi,
> I'm new to prototype and am having a problem with Ajax.Request. I find
> that it basically just loops round and round and round forever, and
> never finishes.
>
> // uses ajax to attempt to connect to a database. Inserts either yes
> or no into error div
> function form_db(server, username, password, name)
> {
> //alert('hi');
> new Ajax.Request('ajax_handler.php',
> {
> method:'get',
> onSuccess: function(transport){
> var response = transport.responseText || "no response text";
> alert("Success! \n\n" + response);
> },
> onFailure: function(){ alert('Something went wrong...') }
> });
>
> }
>
> This just constantly alerts "success + " the correct response from
> php, but it alerts again and again and again and never stops! If I
> comment out the prototype code and uncomment alert('hi'), that only
> alerts once so it must be a problem with the prototype usage. Could
> someone explain to me how to get it to just do one request then
> finish?
>
> Thanks,
> Simon
> >
>
--
Science answers questions; philosophy questions answers.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---