Gelera, I need to open a div
via ajax by passing a ID
via POST
. Where am I going wrong.
HTML
<div class="row">
<div id="retorno_galeria">
<a onclick="galeria_id(this.id,' . $gal["id"] . ');" href="#">
</div>
</div>
JavaScript
function galeria_id(id) {
var idGaleria = (this.value.id);
$.post(URL + 'Ajax/galeria', {val: idGaleria}, function (busca) {
$('#retorno_galeria').html(busca);
});
}
PHP
case 'galeria':
$char = $_POST['val'];
$tbody .= 'Teste retorno galeria ' . $char . '';
$retorno = $tbody;
break;