I want to send base_url from Controller Book to book.js
This is my function in book.js
function loadPage(page, pageElement) {
// Create an image element
var img = $('<img />');
img.mousedown(function(e) {
e.preventDefault();
});
img.load(function() {
// Set the size
$(this).css({width: '100%', height: '100%'});
// Add the image to the page after loaded
$(this).appendTo(pageElement);
// Remove the loader indicator
pageElement.find('.loader').remove();
});
// MY PROBLEM is here !!! Load the page
// img.attr('src', '../../_library/book/samples/magazine/pages/' + page + '.jpg');
img.attr('src', '<?php echo base_url($source) ?>' + page + '.jpg');
loadRegions(page, pageElement);
}