title: load .php file in div with ajax (wordpress)
body: <p>I have a script that shows a box after i clicked a download link in my single page (this works). </p>
  
  <p>I also want it to load a test.php in a certain div. But for some reason it will not work. test.php is located in my theme folder. Even when I try to ad it to my root it won't work.</p>
  
  <pre><code>    &lt;script&gt;
          $(function() {
          $("body").click(function(e) {
                  if (e.target.id == "contentblock" || $(e.target).parents("#contentblock").size()) {
                      //alert("Inside div");
                      if ($(e.target).is("a")) {
                          $('#afterdownload').fadeIn('slow');
                          $('#ajax').load('test.php');
                      }
                  });
              &lt;?php ?&gt;
          }
          }
          });
          })   
          &lt;/script&gt;
  
      &lt;div id="ajax"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>The test.php file contains this</p>
  
  <pre><code>    &lt;h1&gt;test&lt;/h1&gt;
      &lt;p&gt;You downloaded Post: &lt;?php the_ID(); ?&gt;&lt;/p&gt;
  </code></pre>