The following code worked fine with jquery 1.7.2. But it doesn't with jquery 1.9.1. It gives an error with "Uncaught TypeError. Object [object Object] has no method 'live'.
How can I fix the problem?
<script>
$(document).ready(function(){
var tablecont = $("#tablesorter1");
var module = "category";
function updateitem()
{
$.ajax({
type: "POST",
url: "http://localhost/tangen2014/index.php/category/admin/Ajaxgetupdate",
complete: function(data)
{
tablecont.html(data.responseText);
}
});
}
//on submit event
$(".changestatus").live('click', function(event){
event.preventDefault();
var href = $(this).attr("href");
var id =href.substring(href.lastIndexOf("/") + 1);
$.ajax({
type: "POST",
url: "http://localhost/tangen2014/index.php/kaimonokago/admin/changeStatus"+"/"+module+"/"+id,
complete: function()
{
updateitem();
}
});
});
});
</script>