I am new in PHP, i want to use "base_url"(php variable) in javascript file,But right now i am unable to load image,Here is my current code,How can i do this ? Thanks in advance.
$('#site-logo').find('img').attr( {src:'<?php echo base_url(); ?>assets/images/logo/[email protected]',width:'151',height:'45'} );
base_urlreturns? It should contain the trailing slash too. An easy way probably would be just a relative URL:'/assets/images/logo/[email protected]', no need for PHP.