dimanche 3 juillet 2016

Pulling data from RSS using JQUERY


Objective: Pulling data from an RSS feed and display up to 5 data entries at a time. Issue: URL for reference: https://www.goughrecruitment.com/t/ella-toohey The current issue is when the data is increased more than 5 entries the browser will display an error message of "Stopped scripting". Code: JavaScript: if( $('#jobList-sector.consultant-job-posting').length ){ var candidateJobList = $('#jobList-sector.consultant-job-posting').data('url'); if( candidateJobList.trim() != '' ){ //candidateJobList = candidateJobList + '&addlocation=1&addworktype=1]'; $("#jobList-sector.consultant-job-posting").addClass('loading'); $("#jobList-sector.consultant-job-posting").includeFeed({ baseSettings: { rssURL: [candidateJobList || "/job/rss.aspx"], limit: 5 }, templates: { itemTemplate: '<div class="col-md-4 col-sm-6"><div class="white-bg"><header class="jobpost-head"><time>{{pubDate}}</time>'+ '<h3><a href="{{link}}" title="{{title}}">{{title}}</a></h3></header>'+ '<div class="jobpost-desc">{{description}}</div></div></div>' }, complete: function () { if ($(this).children().length ){ if( $(window).width() > 767 ) { $(this).children().children().equalHeights(); } }else{ $(this).append('<p>No job posted yet!</p>'); $(this).parent().find('.btn').remove(); } $(this).removeClass('loading'); } }); }else{ $('.current-positions, .consultant-link-wrapper .view-all-jobs').hide(); } }

Aucun commentaire:

Enregistrer un commentaire