jquery / ajax / php büyük problem

0 Cevap php

I've a big problem creating my intranet. I made a main page with a label menu, clicking on voices I load form structure page in a div and populate it with ajax, all works well the problem starts when I try to add new data or to update data, the posted information are sent several times to php process page. Sometimes are sent simply one time other time 3-4 or more times, seems that data are cached in some strange way... For your experience where may be the problem? My ajax code is written in main page and load page that may be a problem? Is it better to save it in a separated page?

Şimdiden teşekkürler ve benim genel soru için beni bağışlayın ..

ciao h.

Bu ekleme kodu bir parça bulunuyor:

$("#new_def").live("click", function()
{
    var stringa = $("#new_def > div").attr("id");
    var nodi=stringa.split("_");
    $("#scheda_ris").html("");
    $.post("./php/"+nodi[0]+".php",
        {azione: "new_def", dati: $("form").serialize()},
        function(xml)
        {

            if ($("status", xml).text()=="1")
            {
                $("#scheda_ris").append("<img src='./img/validyes.png' alt='ok'><span style='color:green'>" +$("msg", xml).text()+ "</span>\n");
                $("#scheda_sch").html("");
                postaDati("new", $("contratto", xml).text(), nodi[1]);
            }
            else
            {
                $(xml).find("errore").each(function()
                {
                    $("#scheda_ris").append("<img src='./img/validno.png' alt='errore'><span style='color:red'>"+$(this).text()+"<br></span>\n");
                });
            }
        }
    );
});

0 Cevap