title: url in jquery ajax post in codeigniter
body: <p>I am trying to set jQuery Ajax post URL.But it is not working as I want. I searched a lot and I got many solution.But none of them indicate my problem.
  I set the base URL in <code>var baseurl = "&lt;?php print base_url(); ?&gt;";</code> in js file and use it in <code>$.ajax url</code> concatenating it.It gives me</p>
  
  <pre><code>Disallowed Key Characters.php_print_base_url();_?&gt;welcome/add_tag
  </code></pre>
  
  <p>I think the <code>var baseurl</code> is not working.</p>
  
  <p><strong>html</strong></p>
  
  <pre><code>&lt;script src="&lt;?php echo base_url();?&gt;js/my_js.js"&gt;&lt;/script&gt;
  &lt;input type="text" id="add_tag" placeholder="add more tags"/&gt;
  </code></pre>
  
  <p><strong>js</strong></p>
  
  <pre><code>var baseurl = "&lt;?php print base_url(); ?&gt;";
  $('#add_tag').on('keyup paste', function () {
              tag_text=$(this).val();
              if(tag_text==='')
                return;
              $.ajax(
              {
               type: "POST",
               url: baseurl+"welcome/add_tag",
               data: {tag_textTo:tag_text},
               success: function(data){
               $('.tags_found').html(data);
              }
          });
          });
  </code></pre>
  
  <p><strong>CI_Controller</strong></p>
  
  <pre><code>class Welcome extends CI_Controller {
          public function add_tag() 
          {
              $tag_text=$this-&gt;input-&gt;post('tag_textTo');
              echo $tag_text;
          }
  }
  </code></pre>
  
  <p>How to make it work?thanks in advance.</p>