Home Refreshing div with jquery not working properly
Reply: 0

Refreshing div with jquery not working properly

user1299 Published in May 23, 2018, 7:19 am

I am using the jquery news ticker from (http://jquerynewsticker.com/) as my footer. The footer is only loaded once, hence if I get new data to my DB, the new data won't show.

I want that the news ticker div is refreshed by itself every x seconds, so if there is new data in my DB, that it will be shown.

the news ticker is currently:

<div class="footer" id="footerticker">
    <ul id="js-news" class="js-hidden">
    <c:forEach items="${handcarryTicker}" var="handcarry2">
        <li class="news-item">
            <td>LGP: ${handcarry2.item1}</td>

I found several solutions for refreshing a div, but unfortunately, they did not work for me. The footer is loaded and shown 5 seconds and then it disappears. How can I make it that the footer does not disappear after 5 seconds and just refreshes?

My current script is:

    function refresh() {
        setInterval(() => {
            $('#footerticker').load(window.location.href +  ' #footerticker')
        }, 5000);
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.34784 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO