It looks like you are trying to use a PHP variable in javascript. You can use .serialize to collect data and pass it to an ajax call. But as for calls with different named variables for the name of a pair of values, you will need to collect this information from the php page that you pass.
Example:
$.get("jQueryFunctions.php?action=checkCaptula",$('#resetPasswordDiv :input').serialize()).done(function(data){ ....
While this is .get instead of .ajax, it simply shortens the .ajax call. PasswordDiv contains HTML inputs with names and identifiers. It collects the information and passes it to the php page for processing.
Kris.Mitchell
source share