Jquery live function is not working in my case
Hi Guys,
I am very new to jquery live function & i stuck in to the problem.
I am using live function to get the ajax response & appending to the div here is my code,
function add_master(module_url, response_target_id, custom_id) {
$('a.addclass').live('click', function() {alert('add');
$(response_target_id).fadeIn('fast');
$(response_target_id).html(loader_img_url);
$.post(
module_url,{'op':'add','custom_id':custom_id},function(data) {
$(response_target_id).html(data);
set_text_focus();
alert('ho');
});
});
}
Its working on first time but after getting the response, if i again click on the add link
<a href="#" class="addclass" onclick="add_master('configuration/sections/sections','#manage_sections','section');return false;">Add Section</a>
Its calling function two times, if i again click on the link it calls a function three time and sooo
If do you need more details to my problem please ask me.
Please help me as soon as possible.