以下代码与jquery 1.7.2一起工作正常。但它不与jQuery 1.9.1。它给人以“遗漏的类型错误错误。对象的翻译:有没有一种方法‘活’。jQuery 1.9.1没有方法实时错误
我怎样才能解决这个问题?
在此先感谢。
<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>
[jQuery live()适用于jQuery 1.8.3及更高版本,但不适用于1.9.1或2.0](http://stackoverflow.com/questions/16543309/jquery-live-works-with-jquery -1-8-3,但不是与1-9-1或2-0) – Jacob