var doctor; $.ajax({ type: "GET", url: getParams, data: data, success: function (jsonVars) { doctor = jsonVars.doctor; } });