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.
$(document).ready(function(){
$("#scotland").click(function() {
$("#Main").load('thumbs.php #Main', $path=./scotland);
});
});
php div that the jQuery script targets.
<div id="main">
<?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 "<a href='$path/$file'><img class='thumbnail' src='$path/thumbs/thumb_$file' alt='$file'></a>";
}
}
closedir($dir_handle);
}
thumbnailload($path);
?>
</div>