I am not sure if I am doing this the right way but I can't think of any other way of doing this. So here goes.
In my javascript I have a "for" loop setup like this
for(var i = 0; i < data.length; i++)
{
function load_items(){
$.get("list_items.php", function(data){
if(data.length == 0)
{
return;
}
for(var j = 0; j < data.length; j++)
{
create_item(data[j].description, data[j].priority);
}
}, "json");
}
}
I want to send the value of "i" to the php file so then I can just get a list of tasks which have task_id equal to i
So then I can just display these tasks on the webpage.
I have no idea if this is the way to do it but that's the only way I can think of. All other ways that I tried didn't work.
Can someone help me?