I need to instead of the "Live" event in Jquery,so I must to modify my js code. But I come a problem. that is :
jquery api is : on(events,[selector],[data],fn)
But my code has some jquery object,like this:
var $obj=$(".btn");
$obj.live("click",function(){
.....................
});
so I change it:
var $obj=$(".btn");
$(document).on("click",$obj,function(){
.............................
});
the result is when I click dom ,the "click" event runing .....
Thx,my English is not good.forgive me
I have solved it ,thx for friends. "$("").selector" is a String
var $obj=$(".btn"); $(document).on("click",$obj.selector,function(){ .................... });