title: i want to passs javascript variable in site_url in codeigniter
body: <p>Sir Actually i want previous month details onselect both year and month from two seperate drop down lists.so if select both month and year,previous month balance should display in the below text box;so i just want to pass these two javascript variables through site_url.</p>
  
  <p></p>
  
  <pre><code>        $(document).ready(function() {
  
           $('#mm').change(function(){
  
            var mm=$(this).val();//get the month
            var yy=$('#yy').val();//get the year
        if($(this).val())
    {
        window.location="&lt;?php echo site_url('controller/function/'...i want to pass var mm and var yy here;?&gt;"
  
  
    }
  
           });
          });
  
  
  
        &lt;/script&gt;
  &lt;tr&gt;&lt;td&gt;Month:&lt;/td&gt;&lt;td&gt;
  
      &lt;select name="mm" id="mm" style="margin-left:6px;" &gt;
                                 &lt;option value="January"&gt;January&lt;/option&gt;
                                 &lt;option value="February"&gt;February&lt;/option&gt;
                                    &lt;option value="March"&gt;March&lt;/option&gt;
                                    &lt;option value="April"&gt;April&lt;/option&gt;
                                    &lt;option value="May"&gt;May&lt;/option&gt;
                                    &lt;option value="June"&gt;June&lt;/option&gt;
                                       &lt;option value="July"&gt;July&lt;/option&gt;
                                          &lt;option value="August"&gt;August&lt;/option&gt;
                                             &lt;option value="September"&gt;September&lt;/option&gt;
                                                 &lt;option value="November"&gt;November&lt;/option&gt;
                                                 &lt;option value="December"&gt;December&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;
  
                               &lt;tr&gt;&lt;td&gt;Year:&lt;/td&gt;&lt;td&gt;&lt;select name="yy" id="yy" style="margin-left:7px;    margin-top: 26px;"&gt;
                                  &lt;?php    
           for($i=1990;$i&lt;3000;$i++)
           {
             echo "&lt;option&gt;".$i."&lt;option&gt;" ;
           }
           ?&gt;
  
  
  
  
                                  &lt;/select&gt;&lt;/td&gt;&lt;/tr&gt; 
  </code></pre>