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

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

  • martes, 13 de marzo de 2012 16:38
     
      Tiene código

    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); }); } }); }


    • Cambiado Neddy Ren miércoles, 14 de marzo de 2012 4:47 asp.net issue (From:Visual C# Language)
    •  

Todas las respuestas

  • miércoles, 14 de marzo de 2012 4:46
     
     

    Hi,

    You will need to post your questions to the http://forums.asp.net forum for more prefessiona supports. And I will help and move your thread to the off-topic forum. Thank you for understandings.

    Best Regards


    Neddy Ren[MSFT]
    MSDN Community Support | Feedback to us