Ok this is bugging me, I'm trying to do a simple ajax request via a click of a link and even though Success triggers, the response is empty.
<?php
$pid = '123456789';
?>
<script>
$(document).ready(function() {
$('#clickme').click(function() {
alert('You have clicked me');
$.ajax({
url: 'getphoto.php',
type: 'GET',
data: {pid: '<?php echo $pid;?>'},
dataType: 'html',
success: function(data) {
alert('Data Sent: '+ data);
}
});
});
});
</script>
Then the php file:
<?php
if(isset($_GET['pid])) {
$pid = $_GET['pid'];
}
echo 'You wanted to show a PID of: '. $pid;
?>
Why do I get does this successed, but not return anything for `data`