I was thinking it would be a problem along those lines. Now I really don't know Ajax 100%, I know its basic functionalities.
Now below is the code which I think is causing the problems. Basically whats happening is that I go to a php method which calculates the total size of buttons and other values and returns these values. Then as you can see I call a method:
HandleResponseFlowButtonSize(xmlHttp.responseText);
which passes the "response" from the php method and breaks the response up accordingly and sets the values to different variables.
function getbuttonSize(id)
{
checkNumofContainers();
var xmlHttp = getXMLHttp();
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
HandleResponseFlowButtonSize(
xmlHttp.responseText);
}
}
xmlHttp.open("GET", '../ajax/ajax.php?action=checkNumberofButtons&value='+id, true);
xmlHttp.send(null);
}
function HandleResponseFlowButtonSize(response)
{
var reply = response;
var displayButtos = new Array(500);
var getReply = reply.split(",");
for(i = 0; i < 1; i++)
{
buttonSize = getReply[i];
displayButtonNum = getReply[i+1];
numofButtons = getReply[i+2];
}
buttonSize = Number(buttonSize);
displayButtonNum = Number(displayButtonNum);
numofButtons = Number(numofButtons);
}
Do you maybe have a different or should I say better way of doing this??