Passing a URL string to a Javascript fuction
<p>I need to pass a URL to a Javascript function something like the following.   </p>

<pre><code>&lt;script type="text/javascript" language="javascript"&gt;

var xmlhttp='';   
function ajax()
{
    if(window.XMLHttpRequest)
    {
        xmlhttp=new XMLHttpRequest();
    }
    else
    {
         xmlhttp = new ActivexObject("Microsoft.XMLHTTP");
    }
}     

function someFunction(orders_per_page, url)
{
     ajax();
     var val=document.getElementById("txt_order_amount").value; 
     xmlhttp.onreadystatechange=function()
     {
          if(xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
          {                
               document.getElementById("list").innerHTML=xmlhttp.responseText;
          }
     }

     xmlhttp.open("GET",url, true);
     xmlhttp.send();        
}
&lt;/script&gt;

&lt;select 
    id="cmb_page" name="cmb_page" 
    onchange="someFunction(this.value, "reports/OrderAmount.php?val="+val+"&amp;orders_per_page="+orders_per_page+"&amp;pageNo="+getSelectedPage();"&gt;

    &lt;option value="1"&gt;Some Value&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>I need to pass a URL string as mentioned on the <code>onchange</code> even of the <code>&lt;select&gt;&lt;option&gt;&lt;/option&gt;&lt;/select&gt;</code> element. Is it possible?</p>
