Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] AJAX "waiting"?!


  • From: list at tridemail.de (Michael Borchers)
  • Subject: [Javascript] AJAX "waiting"?!
  • Date: Wed Aug 30 07:14:41 2006

the following functions work well. they call a php script via AJAX which 
returns  text.
the text  is parsed into an confirm.
when i try to directely acces the php file while the confirm remains opened,
it seems to hang up loading. is this because the first httpRequest hasn't 
closed yet
and only closes when the confirm is done?!

function getTasksReminders()
{
 httpRequest.open('get', 'ajax.php?ajax_filename=check_tasks.php', true);
 httpRequest.onreadystatechange = function() { remindTasks() };
 httpRequest.send(null);
}

function remindTasks()
{
 if(httpRequest.readyState == 4)
 {
  if(httpRequest.responseText != '')
  {
   confirmTasks = confirm(httpRequest.responseText);
  }

  if(confirmTasks == true)
  {
   document.location.href = 'tasks.php?select=1&search[users_id]=1>';
  }
 }
}