none
ajax .append function not working on first click c# .net

    Pergunta

  • Hi all,

    The below code loads the content from the database and appends it to the destination but

    in the first click the contents comes and goes off in a flash !!

    and it works well from the second click

    why is it happening ?!

    function buddyproducts() { $(document).ready(function () { $.ajax({ type: "GET", url: "Handlers/Hbuddyproducts.ashx", contentType: "application/json; charset=utf-8", data: { intuserid: globaluserid }, dataType: "json", responseType: "json", success: Retbuddyproducts }); function Retbuddyproducts(result) { $("#destination").html(''); $("#destination").empty(); $.each(result, function (i, data) { var prodid = data.intproductid; var chvusername = data.chvusername; var chvproductimg = data.chvproductimg; var prdresult = "<li data-id='" + prodid + "' class='util'> <img src='" + chvproductimg + "' width='92' height='92' alt='' onclick='tretrieveproduct(" + prodid + ")'/> <span>" + chvusername + "</span></li>"; $("#destination").append(prdresult); }); } }); }


    • Movido Neddy Ren quarta-feira, 14 de março de 2012 04:47 asp.net issue (From:Visual C# Language)
    terça-feira, 13 de março de 2012 16:38

Todas as Respostas