GetDescription(WorkshopID).
The function is implemented as an Ajax call and works with no problem. On the server the WorkshopID is used to make a MySQL query to get the description of the workshop.
My question is:
"What if a quick user clicks on a workshop name and then another workshop name before the first call completes?"
EVerything works so well (and quick) that I don't know how to test this situation.
Did I write my ajax code correctly?
The ajax call is the usual asynchronous one - to save space I just summarize it below.
Thank you,
Joe
Expand|Select|Wrap|Line Numbers
- function GetDescription(WorkshopID
- {
- var x = getXMLHttpRequestObject(); // the usual call here
- // test for failure to get request object
- if(!x)
- {
- alert("Ajax Failure");
- }
- x.onreadystatechange = function()
- {
- if(x.readyState != 4)
- {
- return;
- }
- var description = x.responseText;
- alert(description); // Show workshop description
- };
- x.open("POST", ..., true);
- x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
- x.send(...);
- }