a : function () {
$.ajax({
url : 'xxxxxxxx.action',
method : 'post',
success : function (data) {
if (data.success == "true") {
var profiles = data.profiles;
for (var i=0;i<profiles.length;i++) {
if (profiles[i].profileType == "sms") {
//TODO
$('#otpForm input[name="smsPhoneNumber"]').attr('value', profiles[i].identity);
jQuery("<option>SMS</option>").attr("value",profiles[i].profileType).appendTo("#otpForm #prePushOTPMethod");
}
if (profiles[i].profileType == "was") {
$('#otpForm input[name="whatsappPhoneNumber"]').attr('value', profiles[i].identity);
jQuery("<option>Whatsapp</option>").attr("value",profiles[i].profileType).appendTo("#otpForm #prePushOTPMethod");
}
}
} else {}
}
});
$.ajax({
url : 'aaaa.action',
method : 'post',
success : function (data) {
if (data.success == "true") {
var preferPushOTPType = data.preferredType;
$("#otpForm #prePushOTPMethod").val(preferPushOTPType);
//$("#otpForm #prePushOTPMethod").find("option[value=" + preferPushOTPType + "]").attr("selected",true);
} else {}
}
});