You need to sign in to do that
Don't have an account?
gokubi
Looping through an array and refreshing the browser
I'm trying to convert an array of Leads and refresh the browser after each Lead is converted. I've got it all working except for the refresh--currently the browser doesn't refresh until after all the leads have been converted. Here's what I've got.
Code:
Any thoughts on how I could get the page to refresh after processing each row?
Thanks!
Code:
function createLeadToConvert(LeadArray,startRow) { var row = startRow; if (row<LeadArray.length){ ThisLeadId = LeadArray[row]; //lots of conversion code hereThe setTimeout call isn't quoted, so I know that it will fire without the 50 milisecond pause. But I can't seem to pass the LeadArray in when it's quoted. I can pass the startRow, because it's just a number, but I'm unsuccessful at passing the array.
//here I change a part of the page
document.getElementById("Row" + leadId + "Lead").innerHTML = "Converted"; //increment the row I'm looking at
startRow++;
//make the recursive call, hitting the next row of the LeadArray
setTimeout(createLeadToConvert(LeadArray,startRow),50); } }
Any thoughts on how I could get the page to refresh after processing each row?
Thanks!
Hi gokubi,
Steve