Sorry, page not found
The link you followed may be broken, or the page may have been removed. You may search
for whatever you’re looking for here.
`;
suggestions.forEach((suggestion, index) => {
const title = suggestion?.suggestedKeyword;
const category = suggestion?.category || "features";
const encodedKeyword = encodeURIComponent(title);
const href = `/en-in/search?searchkeyword=${encodedKeyword}`;
const safeTitle = title?.replace(/"/g, '"');
html += `
-
`;
});
html += `
`;
// Optional: inject it into a container in the DOM
document.getElementById("suggested-list-id-support").innerHTML = html;
return html;
} catch (error) {
console.error("Failed to fetch suggestions:", error);
document.getElementById('quicklink-list-id-support').style.display = 'block';
document.getElementById('suggested-list-id-support').classList.add("pkv-suggested-list");
return "";
}
// New Func Ends
}
}
const fetchSearchResults = (query) => {
// const onSearchURL = commonApiList?.getApiUrl("ON_SEARCH")+'?q=' + query;
const onSearchURL = `/api/jio-search-service/search/autoSuggest?q=${query}`;
axios?.get(onSearchURL)
?.then(response => {
if (!response?.data || !response?.data?.suggestions || response?.data?.suggestions?.length === 0) {
setResults(null);
setNoResults(true);
} else {
setResults(response?.data);
}
setLoading(false);
})
?.catch(error => {
console.error('Error fetching search results:', error);
setLoading(false);
setResults(null);
setNoResults(true);
});
};
function checkform() { }
function cleanValues(val) {
var updatedVal = "";
var blackListedVal = ["script", "alert", "iframe", "<", ">"];
//updatedVal= val.toLowerCase();
updatedVal = decodeURIComponent(val);
for (i = 0; i < blackListedVal.length; i++) {
if (updatedVal.toLowerCase().indexOf(blackListedVal[i]) > -1) {
updatedVal = updatedVal.replace(blackListedVal[i], "");
}
}
updatedVal = updatedVal.replace(//g, "");
return updatedVal
}
$(document).ready(function () {
$("#clear-btn-search").click(function () {
$('#supportsearchtxt').val('');
$('#searchList-support').hide();
$(this).css('opacity', '0');
});
$("#supportsearchtxt").focus(function () {
console.log("call api");
$('html,body').animate({
scrollTop: $('#supportsearchtxt').offset().top - 105
}, 800);
// getAutoSuggestionsPlainSupport('', 'nothingtosearch123');
});
$("#supportsearchtxt").focusout(function () {
setTimeout(function () {
$('#searchList-support').hide();
}, 500);
});
});
More from Jio