Please help me set this jquery cookies Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
2 posters

    Please help me set this jquery cookies

    zzlasperpen
    zzlasperpen
    Forumember


    Male Posts : 56
    Reputation : 3
    Language : VietNam

    Please help me set this jquery cookies Empty Please help me set this jquery cookies

    Post by zzlasperpen 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
    zzlasperpen
    Forumember


    Male Posts : 56
    Reputation : 3
    Language : VietNam

    Please help me set this jquery cookies Empty Re: Please help me set this jquery cookies

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

    up topic please
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Please help me set this jquery cookies Empty Re: Please help me set this jquery cookies

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

    please post the link of your forum with this table
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Please help me set this jquery cookies Empty Re: Please help me set this jquery cookies

    Post by Ch@lo Valdez 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);
            });
        }
    });

    zzlasperpen likes this post

    zzlasperpen
    zzlasperpen
    Forumember


    Male Posts : 56
    Reputation : 3
    Language : VietNam

    Please help me set this jquery cookies Empty Re: Please help me set this jquery cookies

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

    oh so wonderful thank you