Tasked with developing a webpage similar to Pinterest by utilizing data from a JSON response. Each JSON object contains a service_name key, which can be manual, twitter, or instagram. I made an effort to implement three filter buttons to only display the relevant data on the webpage by using the onclick method in jquery to pass an array to the loadData function. However, clicking on any of these buttons causes the webpage to freeze.
Check out the codepen for reference: https://codepen.io/KevinM818/pen/OjMYYO
$(document).ready(function() {
var service = "";
var datePublished = "";
var manualImage = "";
var manualText = "";
var manualLinkText = "";
var manualLink = "";
var twitterUsername = "";
var twitterTweet = "";
var instaImage = "";
var instaUsername = "";
var instaCaption = "";
var manualItems = [];
var twitterItems = [];
var instagramItems = [];
// Rest of the code remains as is ...