Jump to content

live is not a function


Recommended Posts

Hi Guys


I have the following page



<script src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(function() {

$('.load_more').live("click",function() {

var last_msg_id = $(this).attr("id");

type: "POST",
url: "facebook_style_ajax_more.php",
data: "lastmsg="+ last_msg_id,
beforeSend:  function() {
$('a.load_more').append('<img src="facebook_style_loader.gif" />');
success: function(html){



return false;




This ajax is called when a user clicks a link similar to facebook's Show Older Posts code is below



<ol class="row" id="updates">
$query ="select * from `tbl_news` ORDER BY `news_date` desc LIMIT 9";
$result = mysql_query($query);
    <li> <?php echo $message; ?> </li>
    <?php } ?>

  <div class="facebook_style" id="facebook_style">
  <a id="<?php echo $msg_id; ?>" href="#" class="load_more" >Show Older Posts <img src="img/arrow.png" /> </a>


When I am clicking on the link I am getting the following error showing in Firebug


TypeError: $(...).live is not a function

$('.load_more').live("click",function() {


Where am I goign wrong, I have used th tutorial and source code from the followign page




Link to comment
Share on other sites

You can also use bind, too, which accepts any amount of event binders as space-separated list, "mouseenter mouseleave" for example (which would equal hover, anyway).

.on accepts space-separated event list as well. .bind is also not recommended (use .on instead) but has not been removed as of yet.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.