I get Uncaught ReferenceError: bierta (or whatever the URL var is) is not defined
when I run the AJAX call below. How can I fix this?
$.ajax({
type: "GET",
async: false,
url: "get-single-marker.php",
data: "slug="+<?php echo $_GET['gt']; ?>,
dataType: "json",
success: function(res) {
data = res;
}
});
Try
data: "slug=<?php echo $_GET['gt']; ?>,
or
data:{slug:"<?php echo $_GET['gt']; ?>"},