I have a set of boxes:
HTML
<button class="btn-modal">
<div>Ajax content 1</div>
</button>
<button class="btn-modal">
<div>Ajax content 1</div>
</button>
In the PHP loop I do:
<?php
$permalink = get_permalink(); // Link of the box
?>
<script>
var simple = '<?php echo $permalink; ?>';
</script>
The php loop above prints the correct link for each box link in each simple
variable
I then call the content via ajax like this:
$(document).on( 'click', ".btn-modal", function(){
var cont = $(this).simple + " .content"; // Load via ajax the Box link + content
jQuery(".modal-body").load(cont);
});
The variable simple
is applied to all the boxes correctly but I am not getting this box link on click
but I am getting a no found error instead
http://www.example.com/xchanges/home/work/interactive/undefined 404 (Not Found)