Currently in the process of creating a blog using the HubSpot platform. The primary goal is to have blog posts load dynamically as users scroll down the page. I came across a script that claims to achieve this functionality and is designed specifically for use with HubSpot.
However, upon implementing the script and testing it, I encountered a 403 error in the console when trying to activate it by scrolling. It seems that this issue may be related more to Ajax than to HubSpot itself.
The script I am utilizing can be found at the following URL: www.example.com/swoosh/
Alternatively, the script hosted on our HubSpot CDN can be accessed here:
For reference, the blog can be viewed at the following link:
One potential issue that stands out to me is that the Ajax request is cross-domain. However, given that cross-domain requests are common within HubSpot for files and company domains, I would expect the script's creator to have anticipated and addressed this.
Despite my efforts to find a solution, I have been unsuccessful thus far. It should be noted that a PHP proxy is not a viable option due to the limitations imposed by server-side programming in HubSpot.
Any assistance or advice on how to proceed with this issue would be greatly appreciated.
$(document).ready(function(){
$(".grid").swoosh();
});
(function(a) {
a.fn.swoosh = function(f, k) {
if (!f) {
f = "Loading..."
}
if (k == null) {
k = -1
}
var c = this;
var e = false;
var j = 2;
var d = window.location.href.toString().split("/");
var i = d[0] + "//" + d[2] + "/" + d[3] + "/";
var h = i + "page/";
var g = "";
var b = false;
if (f != "Loading...") {
c.parent().append('<div class="loading"><img src="' + f + '"></div>');
} else {
c.parent().append('<div class="loading">' + f + "</div>");
}
a(".loading").hide();
a(document).scroll(function() {
if (b || e || j == 0) {
return false
}
if (a(window).scrollTop() >= a(document).height() - a(window).height() - a(".footer-container-wrapper").height() - 150) {
b = true;
a(".loading").fadeIn(200);
g = h + j;
a.post(g, function(m) {
var l = a(m).find(".grid-item");
if (l.length) {
console.log(f);
a(".loading").fadeOut(200, function() {
l.appendTo(".grid")
});
j++;
a(".next-posts-link").attr("href", h + j)
} else {
e = true;
a(".next-posts-link").after('<div class="next-posts-link unactive">Next</div>');
a(".next-posts-link:not(.unactive)").remove();
a(".loading").fadeOut(200)
}
b = false;
setTimeout(function() {
twttr.widgets.load();
IN.parse();
FB.XFBML.parse();
gapi.plusone.go()
}, 350)
})
}
})
}
})(jQuery);
(function() {
return window.SIG_EXT = {};
})()