title: Loading php via ajax using jquery
body: <p>I'm trying to load local pages inside of a div. Each menu link will fetch its corresponding content, that contains php, via ajax and this content is then displayed in a div. 
  All of this is hosted on a local server (my pc running xampp), as I develop a theme in WordPress 4.2.2. </p>
  
  <p>The jQuery code I'm using is the following. I added comments for clarity:</p>
  
  <pre><code>jQuery(MLinks).click( function(){ //MLinks is an array of links from the DOM
  var TID=Tabs.indexOf(this);
  switch(TID){ //We find which link has been clicked
      case 0:
          jQuery("#TabCnt").load("http://localhost/project/a #TabCnt"); //load #TabCnt from each page (a, b, c)
      break;
      case 1:
          jQuery("#TabCnt").load("http://localhost/project/b #TabCnt"); 
      break;
      case 2:
          jQuery("#TabCnt").load("http://localhost/project/c #TabCnt"); 
      break;
  }
  if((window.location.href == urlV)||(window.location.href == urlP)||(window.location.href == urlK)){
      return false;
  } //If we're outside of the addresses in urlV, urlK or urlP, behave like a normal anchor
  return; });
  </code></pre>
  
  <p>And the pages loaded contain this code:</p>
  
  <pre><code>get_header(); ?&gt;
  &lt;div id="TabCnt"&gt;
      &lt;div id="primary" class="content-area"&gt;
  
          &lt;?php do_action('slideshow_deploy', '100'); ?&gt;
  
          &lt;main id="main" class="site-main" role="main"&gt;
  
              &lt;?php while ( have_posts() ) : the_post(); ?&gt;
  
                  &lt;?php get_template_part( 'template-parts/content', 'page' ); ?&gt;
  
                  &lt;?php
                      // If comments are open or we have at least one comment, load up the comment template
                      if ( comments_open() || get_comments_number() ) :
                          comments_template();
                      endif;
                  ?&gt;
  
              &lt;?php endwhile; // end of the loop. ?&gt;
  
          &lt;/main&gt;&lt;!-- #main --&gt;
      &lt;/div&gt;&lt;!-- #primary --&gt;
  &lt;/div&gt;&lt;!-- #TabCnt --&gt;
  </code></pre>
  
  
  
  <p>Everything works as I want it, except for this line: </p>
  
  <pre><code>&lt;?php do_action('slideshow_deploy', '100'); ?&gt; 
  </code></pre>
  
  <p>It comes from a slideshow plugin. This problem is not specific of this plugin, as I've tried others.</p>
  
  <p>I also tried creating separate files only containing a very similar line and then loading the document through an iframe on the target html, like so:</p>
  
  <pre><code>&lt;iframe src="slideshow_a.php"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>This throws back an error. </p>
  
  <p>I don't have much expertise, but I think the php code isn't being sent to the server when I use ajax to retrieve the content. </p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks!</p>