Sending multiple data parameters with jQuery AJAX

Here is how POST data should be formatted:

key1=value1&key2=value2&key3=value3

In your case (note the & as a separator):

'code=' + code + '&userid=' + userid

But jQuery does that for you if you specify your data as an object:

data: { code: code, userid: userid }

you should set your data like so :

data: 'code='+code+'&userid='+userid

you can try this :

data: 'code='+code+'&userid='+userid,

instead of

data: 'code='+code+'userid='+userid,