Click to See Complete Forum and Search --> : indepenedent instancies of XMLHttpRequest


orHor
06-25-2007, 03:57 AM
Hi,
please, take a look at http://orhor.wz.cz/rqst/

there is a document containing two checkboxes.

This is only illustrating example of my trying to have independent instancies of Ajax working.

when you click on one checkbox, all is OK. Ajax call back.php, waits for response and then executes the function. What if I click one checkbox and immediately after that the second one. The response is delivered only for the second one.

can you advise any solution to have more fully functional independent instancies of AJAX in one page?

thank you.


back.php code:
<?php
$id=$_GET['id'];
sleep(3); // for testing reasons
echo "blockResult('$id',true);";
?>

Alan Sugar
06-25-2007, 04:23 AM
You dont have "Independent" instances of Ajax, the idea is you write an Ajax routine to be useable over and over again that will do the requests you pass it.

orHor
06-25-2007, 04:51 AM
thank you for answering. This was my first opinion too. But when I tried to call one global instance of Ajax, some strange behaviour of checkboxes occured. They throwed some exceptions in Firefox.

Alan Sugar
06-25-2007, 04:57 AM
Well post the code you have and someone may be able to help you.

each time you want to use the object, you HAVE to create a new object to make your request...

so people need to see your script to understand and help you.

orHor
06-25-2007, 06:24 AM
the script is of course readable at the adress I wrote.

my problem is solved now. I overlooked missing var so an object was created globaly.

thank you.

Alan Sugar
06-25-2007, 06:33 AM
var doesnt make a varible global.