title: Making on click event work with AJAX & PHP loading php files into div?
body: <p>Currently I have this code for loading a file into a div. At the moment when I click on one of the options it simply links to the page instead of loading the page into the div with AJAX.</p>
  
  <pre><code>$(document).ready(function(){
    $('.eventSelect').click(function(){
      var url = 'includes/events.php';
      $('.content').load(url); 
    });
  });   
  
  $(document).ready(function(){
    $('.podSelect').click(function(){
      //Retrieve Content from the back-end PHP page, and pass the ID selected
      var url = 'includes/content.php';
      $('.content').load(url); 
    });
  });  
  </code></pre>
  
  <p>This is the code with the two options to click. So if I click pods, the content for the pods would then appear in the div class(content) and the same for events.</p>
  
  <pre><code>echo "&lt;div id=\"viewSelect\"&gt;";
  echo "&lt;div class=\"eventSelect\"&gt;";
  echo "&lt;a href=\"/../includes/events.php\"&gt;";
  echo "events";
  echo "&lt;/a&gt;";
  echo "&lt;/div&gt;";
  echo "&lt;div class=\"podSelect\"&gt;";
  echo "&lt;a href=\"/../includes/events.php\"&gt;";
  echo "pods";
  echo "&lt;/a&gt;";
  echo "&lt;/div&gt;";
  echo "&lt;/div&gt;";
  </code></pre>
  
  <p>I think my problem is to do with a href but I'm not sure.</p>
  
  <p>If anyone can help that would be great, thanks.</p>