SIA is Typing...
character(s) remaining
Was this helpful ?
Thank you for sharing your feedback!
Your Feedback Matters!
Are you a SBI customer?
How was your overall experience with SBI? *
Poor
Average
Good
Outstanding
Submit
Next Time
'
+ getTime()
+ ' ';
text = text + '
';
jQuery("#chat_box_overflow").html("");
jQuery("#chat_box_overflow").append(text);
jQuery('#chat_box_overflow').scrollTop(
jQuery('#chat_box_overflow').height()
* jQuery('#chat_box_overflow')
.height());
} else {
resposne = resposne.replace(/
/g,
'');
msg_counter = msg_counter + 1;
intentName = data.intentName;
var text = '';
text = text + '
'
+ resposne + '
' + getTime()
+ ' ';
var suggestions = data.suggestions;
for (var i = 0; i '
+ suggestions[i] + '';
}
text = text + '
';
jQuery("#chat_box_overflow").html("");
jQuery("#chat_box_overflow").append(text);
jQuery('#chat_box_overflow').scrollTop(
jQuery('#chat_box_overflow').height()
* jQuery('#chat_box_overflow')
.height());
}
}
});
}
function fetchQueryResponse(query) {
var counter = msg_counter;
var chatId = chat_id;
var intent = intentName;
jQuery("#query").attr('disabled', 'disabled');
jQuery("#query").val("");
query = encodeURI(query);
var url = 'https://www.sbi.co.in/web/wealth-management/investment-other-products?p_p_id=ChatBotPortlet&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=chat&p_p_cacheability=cacheLevelPage';
jQuery
.ajax({
url : url,
type : "post",
dataType : "json",
crossDomain : true,
data : {
"_ChatBotPortlet_userInputMessage" : query,
"_ChatBotPortlet_isConfirmation" : "false",
"_ChatBotPortlet_botResponseMessage2" : "",
"_ChatBotPortlet_defaultIntentName" : "root_WhatYono",
"_ChatBotPortlet_botResponseMessage1" : "",
"_ChatBotPortlet_intentName1" : "",
"_ChatBotPortlet_botResponseMessage" : "",
"_ChatBotPortlet_intentName2" : "",
"_ChatBotPortlet_conversationID" : chatId,
"_ChatBotPortlet_speechBotResponseMessage" : "",
"_ChatBotPortlet_intentName0" : "",
"_ChatBotPortlet_suggestions" : [],
"_ChatBotPortlet_speechID" : "",
"_ChatBotPortlet_recommendations" : [],
"_ChatBotPortlet_messageCounter" : counter,
"_ChatBotPortlet_intentName" : intent,
"_ChatBotPortlet_channel" : "MB"
},
success : function(data) {
jQuery(".typing").hide();
initialResponse = true;
jQuery("#query").removeAttr('disabled');
var resposne = data.botResponseMessage;
if (typeof resposne === "undefined") {
msg_counter = msg_counter + 1;
intentName = data.intentName;
var text = '';
text = text
+ '
SIA is Currently Not available. Please try after some time
'
+ getTime()
+ ' ';
text = text + '
';
jQuery("#chat_box_overflow").html("");
jQuery("#chat_box_overflow").append(text);
$('#chat_box_overflow').animate(
{
scrollTop : $('#chat_box_overflow')
.prop("scrollHeight")
});
} else {
resposne = resposne.replace(//g,
'');
msg_counter = msg_counter + 1;
intentName = data.intentName;
var text = '';
text = text + '
'
+ resposne + '
' + getTime()
+ ' ';
var suggestions = data.suggestions;
for (var i = 0; i '
+ suggestions[i] + '';
}
text = text + '
';
jQuery("#chat_box_overflow").append(text);
jQuery('#chat_box_overflow').scrollTop(
jQuery('#chat_box_overflow').height()
* jQuery('#chat_box_overflow')
.height());
jQuery("#chat_likes").css("display", "block");
}
}
});
}
function setUserResponse(sentence) {
var text = ' '
+ getTime()
+ '
';
jQuery('#chat_box_overflow').scrollTop(
jQuery('#chat_box_overflow').height()
* jQuery('#chat_box_overflow').height());
jQuery("#chat_box_overflow").append(text);
}
function callAlt(text, e) {
var isDisabled = $('#query').prop('disabled');
if (!isDisabled) {
var query = $(e).text();
var newStr = text.replace(/%20/g, " ");
jQuery(".typing").show();
setUserResponse(query);
fetchQueryResponse(newStr);
}
}
jQuery('#query').keypress(function(e) {
var key = (event.keyCode ? event.keyCode : event.which);
if (key == 13) {
jQuery("#query_counter").html("300");
var sentence = jQuery("#query").val();
sentence = jQuery(jQuery.parseHTML(sentence)).text();
if (sentence.length == 0) {
jQuery("#query").val("");
return;
}
var query = jQuery("#query").val();
jQuery("#query").attr('disabled', true);
$(".typing").show();
setUserResponse(sentence);
fetchQueryResponse(query);
}
});
jQuery("#query_img").on(
'click',
function() {
jQuery("#query_counter").html("300");
if ((jQuery.trim(jQuery('#query').val()) != '')
&& (jQuery("#query").val()).length 12) {
hours = hours - 12;
timeFlag = "PM";
}
if (hours.length == 1) {
hours = "0" + hours;
}
if (minutes.length == 1) {
minutes = "0" + minutes;
}
var time = hours + ":" + minutes + " " + timeFlag;
return time;
}