(function($) { $(function() { $.ajax({ url: 'https://www.markwaxman.ca/listings', cache: false, dataType: 'html', success: function(html) { var loadListEl; $('.blog-post', $(html)).each(function(i) { if ( i < 4 ) { var _this = $(this), $title = _this.find('.blog-title a'), link = $title.attr('href'), titleText = $title.text(), image = _this.find('.wsite-image').first().html(), $newitem = '
'+image+'
View Listing
'; $('#load-listings').append($newitem); } }); $('.listing-load-el').find('img').wrap('
'); } }); // ajax LISTINGS $.ajax({ url: 'https://www.markwaxman.ca/blog', cache: false, dataType: 'html', success: function(html) { var loadListEl; $('.blog-post', $(html)).each(function(i) { if ( i < 6 ) { var _this = $(this), $title = _this.find('.blog-title a'), link = $title.attr('href'), titleText = $title.text(), image = _this.find('.wsite-image').first().html(), $newitem = '
'+titleText+'
'+image+'
Read Article
'; $('#load-blogs').append($newitem); } }) } }); // ajax BLOGS $.ajax({ url: 'https://www.markwaxman.ca/faqs', cache: false, dataType: 'html', success: function(html) { var loadListEl; $('.blog-post', $(html)).each(function(i) { if ( i < 4 ) { var _this = $(this), $title = _this.find('.blog-title a'), link = $title.attr('href'), question = _this.find('h2.wsite-content-title').first().text(), $newitem = '
'+question+'
View Answer
'; $('#load-faqs').append($newitem); } }) } }); // ajax FAQS }); }(jQuery));