I have the following java script function
<script type="text/javascript">
function taskDone(taskID) {
alert(taskID);
var btn = document.getElementById('btn-taskDone-' + taskID);
var icon = document.getElementById('task-icon-' + taskID);
btn.style.color = '#8F9199';
btn.onclick = "";
btn.style.cursor = 'default';
icon.src = "./../Images/Icons/doneTask.png";
'<%=setDone(123)%>'
}
</script>
and the following code behind method
public Boolean setDone(int taskID)
{
BO.taskDao myTask = new BO.taskDao();
Boolean success = myTask.setDone(1, taskID);
return success;
}
and i want to call setDone method from javascript function and passing taskID instead of 123, but i don't now how to do that. and i didn't know why server automatically run this line of script '<%=setDone(123)%>' when the page loaded and without call taskDone "JavaScript" function