[jQuery] Passing extra data to AJAX handler functions

[jQuery] Passing extra data to AJAX handler functions

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I commonly want to pass an ID or some other information I know to an
AJAX success handler.
<blockquote type="cite">      $.post('/ajax/asset/insert', {
        folder_tid : lastUploadedFolderTID,
        link       : linkQueue[id]
      }, handleAddLinkComplete, 'json');</blockquote>
In this example, I want to pass an ID to handleAddLinkComplete
function. I know I can do the following, but they seem crufty to me.
<ol>
<li>I can set a global variable with the link ID, but what if I have
a bunch of post calls, there are synchronous issues (I know I can do
async : false too)</li>
<li>I could have my /ajax/asset/insert callback return the link ID
back to me in the response, but it seems silly if I already know it.</li>
</ol>
I would love to do something like...
<blockquote type="cite">      $.post('/ajax/asset/insert', {
        folder_tid : lastUploadedFolderTID,
        link       : linkQueue[id]
      }, { callback : handleAddLinkComplete, arguments : [123] },
'json');</blockquote>
or something.
What is the best way here or is my dream a reality?
Cheers,
-Rob
</body>
</html>