$(document).ready(function(){ getFaqs() }) function getFaqs(){ $.ajax({ async: true, url: `${FAQS_API_URL}`, type: 'GET', error: function(res) { const response = JSON.parse(res.responseText) }, success: function(res) { renderFaqs(res.data) } }); } function renderFaqs(data){ let faqHtml = '' for(let i=0; i

${data[i].answer}
` faqHtml += item_html } $('#faq-content').html(faqHtml) }