修改的保存的js 不指定

Else , 2010/06/22 15:35 , 代码片段,演示也有 , Comments(0) , Reads(450) , Via Original

function pedit(ids)
{
    if($("#p"+ids).attr("src")==tempale+"yes.gif")
    {

        $.ajax({
            type: "POST",
            url: "adminajax.php?act=pedit",
            data: "&id="+ids+"&"+$("#tr"+ids+" input").serialize(),
            success: function(msg){
                $("input:text", "#tr"+ids).each(function(i,n){
                    $("#tr"+ids+">td>span").eq(i).text($(n).val());
                  
                });
                $("#msg").html(ids+msg);


                $("#p"+ids).attr("src",tempale+"edit.gif");
            }
        });

    }
    else
    {
        $("#p"+ids).attr("src",tempale+"yes.gif");
        var lenarr = ["85px","50px"];
        var typear = ["text","text"];
        var namear = ["price","zhekou"];
        $("span", "#tr"+ids).each(function(i,n){
            $(n).html("<input name='"+namear[i]+"' style='width:"+lenarr[i]+";' type='"+typear[i]+"' value='"+$(n).text()+"' />");
        });
    }
}
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]