title: Jquery/Ajax cookie call
body: <p>How would I make an ajax call if a page detects a cookie is present? The code below fires the alert but not the ajax call. Any help greatly appreciated. </p>
  
  <p>EDIT: Updated and fully working code below. Simply had to change $(this) to $('.more') when the cookie is found. Many thanks for help/advice. </p>
  
  <pre><code>$(document).ready(function(){                                                     
          //More Button            
          $('.more').live("click",function() 
          {    
          $.cookie('viewing_expanded_content',true, { expires : new Date(new Date().valueOf() + 60 * 60 * 1000) });
          var ID = $(this).attr("id");
          if(ID)
          {                        
          $("#more"+ID).html('&lt;img src="images/more_press.gif" alt="More results..." /&gt;');
          $.ajax({                   
          type: "POST",
          url: "more_press.php",
          data: "lastmsg="+ ID, 
          cache: true,
          success: function(html){                                        
          $("div#updates").append(html);
          $("#more"+ID).remove();
                  }            
              });
          } else {
          $(".morebox").html('&lt;p&gt;&lt;strong&gt;No more results...&lt;/strong&gt;&lt;/p&gt;');
          }
          return false;
                  });
  
          var viewing_expanded_content = $.cookie('viewing_expanded_content');
          if ( viewing_expanded_content == 'true' ) {
  
          //alert("Active cookies!");    
  
          var ID = $('.more').attr("id");
          if(ID)
          {                        
          $("#more"+ID).html('&lt;img src="images/more_press.gif" alt="More results..." /&gt;');
          $.ajax({                   
          type: "POST",
          url: "more_press.php",
          data: "lastmsg="+ ID, 
          cache: true,
          success: function(html){                                        
          $("div#updates").append(html);
          $("#more"+ID).remove();
                  }            
              });
          }
  
              }
  
          })            
  </code></pre>