The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Please help me set this jquery cookies

View previous topic View next topic Go down

Please help me set this jquery cookies

Post by zzlasperpen on August 28th 2016, 3:57 pm

Code:
    $(".ldulieu").load("/search?search_keywords=codefm&is_tag=true&search_time=0&show_results=topics  table.table .statused tr:lt(15)", function() {
        var a;
        for (a = 0; 15 > a; a++) $(".lreply:eq(" + a + ")").html($(".ldulieu tr:eq(" + a + ") .tc3:eq(0)").html()), $(".lviews:eq(" + a + ")").html($(".ldulieu tr:eq(" + a + ") .tc3:eq(1)").html());
        $(".latesttopicz").show()
    });

I need to set cookies for jquery passage in 24 hours, would you please help me

zzlasperpen
Forumember

Male Posts : 26
Reputation : 1
Language : VietNam

http://www.hotrofm.net/

Back to top Go down

Re: Please help me set this jquery cookies

Post by zzlasperpen on August 29th 2016, 9:43 am

up topic please

zzlasperpen
Forumember

Male Posts : 26
Reputation : 1
Language : VietNam

http://www.hotrofm.net/

Back to top Go down

Re: Please help me set this jquery cookies

Post by Ch@lo Valdez on September 5th 2016, 6:59 pm

please post the link of your forum with this table

Ch@lo Valdez
Forumember

Male Posts : 100
Reputation : 31
Language : spanish

Back to top Go down

Re: Please help me set this jquery cookies

Post by Ch@lo Valdez on September 5th 2016, 7:37 pm

ok i think you want storage data every 24 hrs and after this time update with load function

try with:

Code:

$(function () {
    var a, b, d, c, w = window.localStorage;
    if (w.getItem("latesttopic_") || w.getItem("latesttopic_exp_") > +new Date - 24 * 60 * 60 * 1000) {
        $(".ldulieu").html(w.getItem("latesttopic_"))
    } else {
        $(".ldulieu").length > 0 &&  $(".ldulieu").load("/search?search_keywords=codefm&is_tag=true&search_time=0&show_results=topics  table.table .statused tr:lt(15)", function () {
            for (a = 0; 15 > a; a++) {
                b = $(".ldulieu tr:eq(" + a + ") .tc3:eq(0)").html();
                c = $(".ldulieu tr:eq(" + a + ") .tc3:eq(1)").html();
                $(".lreply:eq(" + a + ")").html(b),
                    $(".lviews:eq(" + a + ")").html(c);
                $(".latesttopicz").show();
            }
            d = $(".ldulieu").html();
            w.setItem("latesttopic_", d);
            w.setItem("latesttopic_exp_", +new Date);
        });
    }
});

Ch@lo Valdez
Forumember

Male Posts : 100
Reputation : 31
Language : spanish

Back to top Go down

Re: Please help me set this jquery cookies

Post by zzlasperpen on September 7th 2016, 1:40 pm

oh so wonderful thank you

zzlasperpen
Forumember

Male Posts : 26
Reputation : 1
Language : VietNam

http://www.hotrofm.net/

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum