Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
$("[id$='Show']").on("click", function () {
        try {
            var id = $(this).attr('id');

            var symbol;

            var context;
            if (id.toString().indexOf('Bullish', 0) > 0) {

                symbol = $("#drpBullishSymbol option:selected").text();

                context = $("#AA");
            }
            if (id.toString().indexOf('Bearish', 0) > 0) {

                symbol = $("#drpBearishSymbol option:selected").text();

                context = $("#BA");
            }
            if (symbol.toString().length > 0) {
                $("tr", context).each(function () {
                    if ($('td:eq(0)', this).text() !== symbol) {
                        $(this).hide();

                        //$(this).css('visibility', 'collapse');
                    } else {

                        $("#AA").before($(this).show());
                        WriteCookie(symbol);




                    }
                });
            }

                   } catch (ex) {
            alert("While filtering details : " + ex);
        }
    });


})
function WriteCookie(symbol) {
    document.cookie = symbol ;
    alert("Cookie Name=" + symbol);
}


This is my javascript which use to click on show button it add cookie and show which is select in dropdownlist. I used this function for write cookie but now i want that when i refresh page saved cookie display on table row which is select previous so having some information or solution in javascript please help.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900