My code is very long and I will keep it very short, I am creating a div which has edit text thing and when I press edit the div get invisible and textarea comes, then if we make change to it it fires an onchange that execute a function update,which happens at first time , but If I try to do it for second time it gives me error that the update function doesn't exist let me show some code.
HTML
<textarea id='input_val_q' style='width:350px;height:50px;' onchange='update(q)' autofocus></textarea>
JS
function update(hint) {
update = $('#input_val_' + hint + '').val();
$.ajax({
type: "POST",
url: "profile/update_data/" + hint + "",
data: {
data: update
},
cache: false,
success: function(html) {
$('#material_' + hint + '').html(update);
}
});
}
You are overwriting the function with a variable. See the problem area
Thus you are getting the error. You just need to just rename the variable.