I am having real problems understanding the logic of passing information from PHP to JS and back. I have been up all night working on this and would really appreciate if someone can show me how to pass two variables to an ajax function.
$assetPath and $count in to the lines commented below. I have tried including them by adding php but in the DOM it shows up as an empty string and I cannot get the desired outcome.
var assetPath ='<?php echo $assetPath; ?>';
var num ='<?php echo $count; ?>';
(function($) {
$(document).ready(function(){
$('.pager-top,.pager-bottom').bootpag({
total: assetPath,
page: 1,
maxVisible: 5,
leaps: true,
firstLastUse: true,
first: '←',
last: '→',
wrapClass: 'pagination',
activeClass: 'active',
disabledClass: 'disabled',
nextClass: 'next',
prevClass: 'prev',
lastClass: 'last',
firstClass: 'first'
}).on("page", function(event, num){
$.ajax({
url: "assetPath?pageNumber="+num,
}).done(function(data) {
$("#productResults").html( data );
});
});
})( jQuery );
});
$assetPathreally have a value inside?