0
i have written code to get max data from database and then insert that data in another table but it is not giving data first time.it is giving leadid as undefined because it is not waiting result of getMaxLeadId and executing second statement.my code is given below
var leadId = getMaxLeadId();
alert("leadId"+leadId);
function getMaxLeadId() {}
function getMaxIdData_success(tx, result){}
後,我需要插入maxLeadId
進入插入函數調用。
請建議我一些想法如何在java腳本中編寫回調函數。