Passing parameters to a javascript callback function
<p>I've been trying to work out how to pass additional parameters to a javascript callback function.</p>

<p>In similar posts users have succeeded using anonymous function (these are new to me so I may have been doing them wrong) but I just can't get them to fire.</p>

<p>The below is what I have now, I need to be able to pass the itemId to the function "ajaxCheck_Callback" as well as the response.</p>

<p>Hope this makes sense.</p>

<p>Thanks for the help.</p>

<pre><code>function delete(itemId)
{
  selectpage.ajaxCheck(itemId, ajaxCheck_Callback);
}


Function ajaxCheck_Callback(response)

{
  alert(response);
  alert(itemId);
}
</code></pre>

<p>Thanks for the help guys. I now get undefined on my alert whereas previously this was alerting correctly.</p>

<pre><code>function delete(itemId)
{
  selectpage.ajaxCheck(itemid, function () {ajaxCheck_Callback(itemid); });
}


function ajaxCheck_Callback(response)

{
  alert(response);
  alert(itemId);
}
</code></pre>
