var n = 1; ... sendAjaxRequest('/get-row.php?i='+(n+1)); n++; ... sendAjaxRequest('/get-row.php?i='+(n+1)); n++;