Auto InsuranceAll StoriesAuto InsuranceTech TrendsCar Buying Auto Should you get your car serviced at an auto shop or a dealership? Auto Insurance Customers say these are the best car insurance companies in Ontario Auto Insurance We asked Ontario’s political parties how they plan to make car insurance cheaper Car Buying The 2018 Canadian Car Buying Guide Auto Insurance Newfoundland drivers say keeping up with car insurance payments ‘financially difficult’ Auto Insurance Lawsuit alleges insurer used credit scores to lowball accident claims Pages« first‹ previous123…next ›last » (function(){ var pager = document.getElementById("pager"); var nodes = pager.getElementsByClassName("pager-last"); var hasNext = false; if(nodes.length > 0) { hasNext = !!nodes[0].innerHTML.replace(" ", "").trim(); } // Show more button and add functionality if(hasNext) { var moreButton = document.createElement("a"); moreButton.id = "show-more"; moreButton.className = "button"; moreButton.href = "?page=2&category=247"; moreButton.innerHTML = "More stories"; moreButton.addEventListener("click", showMore, false); pager.parentNode.appendChild(moreButton); } pager.parentNode.removeChild(pager); function showMore(e) { var button = e.currentTarget; if(button.getAttribute("data-disabled")) { e.preventDefault(); } else { var queryPos = button.href.indexOf("?"); if(queryPos >= 0) { e.preventDefault(); // Set button state to loading button.setAttribute("data-originaltext", button.innerHTML); button.setAttribute("data-disabled", "1"); button.innerHTML = "Loading..."; // Get request data var query = button.href.substring(queryPos); // Send request var request = new XMLHttpRequest(); request.onreadystatechange = function() { if(request.readyState == 4) { if(request.status != 200) { location.href = button.href; } else { // Parse data var data = JSON.parse(request.responseText); // Add new node to the document var DOM = document.createElement("div"); DOM.innerHTML = data.html; var list = DOM.firstChild; list.style.opacity = 0; list.style.transition = "opacity 0.7s"; setTimeout(function() { list.style.opacity = 1; }, 100); var target = button.parentNode; target.parentNode.insertBefore(list, target); // Update the button button.innerHTML = button.getAttribute("data-originaltext"); button.setAttribute("data-disabled", ""); if(data.has_more) { button.href = "?page=" + data.next_page + "&category=" + encodeURIComponent(data.category); } else { button.style.display = "none"; } } } }; request.open("GET", "/ajax/blog/" + query, true); request.send(); } } } })();