I am returning phtml file content on ajax call in Magento2 its working fine, In the phtml file I am loading jquery and mine custom js file booking
, using below code. A query function running fine, but the custom is not loading because called js function returning not defined
error -
Here is my code -
require([
"jquery",
"booking"
], function(jQuery){
jQuery(function ($) {
$("#load_more").click(function(){
var c = 1;
var total_rows = 1;
$.each($(".location_time"), function(){
if($(this).css("display") != 'none'){ ++total_rows; };
if($(this).css("display") == 'none' && c<=<?php echo $showRows;?>){
$(this).css("display","table-row");
++c;
}
});
if(total_rows == $('#total_rows').val() || c < <?php echo $showRows;?>){
$('#load_more').hide();
}
});
bookingTable = $("#booking-table");
setAddressLocationRows(bookingTable);
});
});
Error I am getting is -
Uncaught ReferenceError: setAddressLocationRows is not defined
Please let me know, what I am doing wrong.
Regards Atul