To pass parameters to Result handler function in javascript
<p>I am making <code>XMLHttpRequest</code> to call Google search API URL. And on getting the response I want to call another result Handling function. But I also want to pass the parameter to it.</p>

<pre><code>request = new XMLHttpRequest();

if(request) {
    var url = "http://localhost:8080/final_project/SearchService";
    url += "?user_query=" + getQueryString();

    request.onreadystatechange = handleSearchResult;
    request.open("GET", url, true);
    request.send(null);
}
</code></pre>

<p>Here <code>handleSearchResult</code> is <code>resultHandler</code> and I want to pass parameter to this function. But if I do so the function gets called directly.</p>

<p>What can be done to solve this problem?</p>
