title: Using jQuery .load() to pass a parameter to and call a php function
body: <p>This is the jQuery .load function I have.  What I want to do is run the php function with a passed value from the jQuery.  I think I just don't understand how to pass values with jQuery to the server.  Do I perhaps need to use .get or .post?  Please advise.</p>
  
  <pre><code>$(document).ready(function(){
    $("#scotland").click(function() {
      $("#Main").load('thumbs.php #Main', $path=./scotland);
    });
  });
  </code></pre>
  
  <p>php div that the jQuery script targets.</p>
  
  <pre><code>&lt;div id="main"&gt;
  &lt;?php
  function thumbnailload($path)
  {
  $dir_handle = @opendir($path) or die("Unable to open folder");
  while (false !== ($file = readdir($dir_handle))) {
  
  if(ereg("(.*)\.(jpg|bmp|jpeg|png|gif)", $file)){
  echo "&lt;a href='$path/$file'&gt;&lt;img class='thumbnail' src='$path/thumbs/thumb_$file' alt='$file'&gt;&lt;/a&gt;";
  }
  }
  closedir($dir_handle);
  }
  thumbnailload($path);
  ?&gt;
  &lt;/div&gt;
  </code></pre>