title: Codeigniter base url didn't recognized in javascript
body: <p>I have an ajax request in my CI application ,here is my cstom.js file for that purpose.</p>
  
  <pre><code>$(document).ready(function(){
      var base_url='&lt;?php echo base_url();?&gt;';
     $('#add-ct').click(function(){      
        $.ajax({
            url:base_url+'stockmanagement/add_category',
            data:{category:$('#category').val()},
            success:function(data){
                alert(data);
            },
            error:function(err){
                alert('error'+err);
            }
        });
     });
  });  
  </code></pre>
  
  <p>But the <code>base_url</code> didn't recolonized, when i check the debug console the <code>base_url</code> is printed as the same as the source code like this way.</p>
  
  <pre><code>var base_url='&lt;?php echo base_url(); ?&gt;';
  </code></pre>
  
  <p><strong>UPDATE</strong></p>
  
  <p>my javascript file is included in a view file</p>
  
  <pre><code>&lt;?php if($page=='add-category'){ echo '&lt;script src="'.base_url().'/assets/js/custom.js"&gt;&lt;/script&gt;'; }?&gt;
  </code></pre>