Javascript append works in Firefox but not IE

Discussion in 'JavaScript' started by cavendano, Aug 29, 2010.

  1. #1
    I am using some javascript code that I found on the net...
    I modified it a little bit but I have an annoying problem.
    The code works great on firefox and chrome but on IE I have to refresh the page otherwise it wont work.

    <script type="text/javascript">
    var clickCount = '0';
    $(function() {
    $('.load_more').live('click',function() {
    var pages = ++clickCount;
    var page = $(this).attr('id');
    var genre = '<?=$pgenre;?>';
    var artist = '<?=$partist;?>';
    var search = '<?=$psearch;?>';
    var sort = '<?=$psort;?>';
    
    if(page!='end'){
      $.ajax({
    type: "POST",
    url: "facebook_style_ajax_more.php",
    data: "page=" + page + "&genre="+ genre + "&artist="+ artist + "&search="+ search + "&sort="+ sort + "&pages="+ pages, 
    
    beforeSend:  function() {
    $('a.load_more').append('<img src="facebook_style_loader.gif" />');
      
    },
    success: function(html){
        $('.facebook_style').remove();
    $('ol#updates').append(html);
    }
    });
      }
    
    return false;
    
    });
    });
    </script>
    
     <div class="facebook_style" id="facebook_style">
      <a id="<?php echo $msg_id; ?>" href="#" class="load_more" >Show More  <img src="arrow1.png" /> </a>
      </div>
    
    Code (markup):
     
    cavendano, Aug 29, 2010 IP