by Niko January 17th 2022, 2:57 pm
@infotmt Here I am
I needed to change the script you provided because sadly in jQuery the function
does not directly have cache support. For this reason we will turn this into
Go to
ACP > Modules > HTML & Javascript > Javascript codes management and create a new javascript with these settings, upon having verified that Javascript management is enabled:
- Title: as you prefer
- Where: in all pages (or in any case where the element is)
- Code:
- Code:
$(function() {
var element = $("#newtopic");
var targetPage = '/f1-';
$.ajax({
url: targetPage,
cache: true,
type:'GET',
success: function(data){
var retrieveContent = $(data).find('.topictitle:lt(10)').html();
$(element).html(retrieveContent);
}
});
});