Hi boy @ s I'm looking for a way to generate a random content sheet (chunks of lyrics) that refreshes every x seconds.
So far I have managed to get the system to visualize the random content (great) every time I update the page and also refresh it automatically.
The issue is that I am seeing that it consumes too many resources and that it seems excessive to reload all the code blocks when I only need the songs.
To refresh I am using a javascript code that I have found on the net although it is very crazy because I can not generate a button that deactivates it and becomes a bit heavy. I have seen that with ajax it can be done much more efficiently.
I do not control much programming and for this project I am using a content manager.
I'm posting here the code in case it turns out to be helpful.
function reFresh()
{
window.open(location.reload(true))
}
var repeticion = window.setInterval("reFresh()",30000);
<div class="uk-grid-collapse uk-child-width-expand@m uk-margin" uk-grid uk-scrollspy="cls: uk-animation-fade; target: > div > delay: 500; repeat: true">
<div class="uk-flex uk-flex-middle uk-flex-center">
<div class="uk-card-body uk-width-expand uk-text-center uk-light">
<!-- Contenido letras -->
<?php if ($this->checkPosition('copla')) : ?>
<div class="magia"><?php echo $this->renderPosition('copla'); ?></div><?php endif; ?>
</div>
</div>
</div>
<div class="uk-position-small uk-position-bottom-right uk-overlay uk-overlay-default">
<a id="actualizar" href="javascript:location.reload()" onclick="UIkit.notification({message: 'Volai-vai OUTRA!...', pos: 'top-center'})"><span uk-icon="icon: refresh; ratio: 1.5" uk-tooltip="Refrescar cantiga"></span></a>
</div>
<div><form class="toogle-dn" action="" onclick="window.clearInterval(repeticion);"><input class="toogle-dni" type="checkbox" id="toogle" /><label class="toogle-dni" for="toogle"></label></form></div>