使用jquery.form.js有感

在一个项目中,里面的个人中心,有一块是个人填写简历功能的地方。所有的信息填写都是在一个窗体页面中进行,和51job里面的简历功能很像。就是用jquery.form.js的ajaxForm提交方式进行小块的数据提交。如下图:

上面是填写好之后的效果。

修改的效果如下:

但在IE6下面进行测试的时候,发现了一个问题那就是进行修改时,获取不到原来的数据,一查原来是一些JS写法在IE6上面执行起来不太好使。

我使用的jquery-1.4.2.min.js操作的

UpdateEducationClick: function (objformid, obj) { //修改教育经历事件
        $(obj).removeAttr("onclick");
        $(obj).unbind("click");
        var strcount = $("#Education_edit").find("form").length;
        strcount = strcount + 1;
        var strEducationID = $($("#" + objformid).find("#hid_EducationID")).val();
        $.ajax({
            url: "/aspx/resumehtml/ResumeEducationEdit.aspx?hid_Action=update&hid_EducationID=" + strEducationID,
            success: function (data) {
                data = $(data).attr("id", "Education_edit_" + strcount).attr("name", "Education_edit_" + strcount);
                $(data).insertBefore($("#" + objformid));
                $("#" + objformid).remove();
                $($("#Education_edit_" + strcount).find("input[type=\"image\"]")).bind("click", function () { return ResumeEdit.EducationPostClick("Education_edit_" + strcount); });
                $($("#Education_edit_" + strcount).find("input[type=\"image\"]")).bind("click", function () { ResumeEdit.EducationAddCallClick("Education_edit_" + strcount); });
                $($("#Education_edit_" + strcount).find("#Major_div")).bind("click", function () { ResumeEditExt.EducationMajorClick(); });
                $($("#Education_edit_" + strcount).find(".shanchu a")).bind("click", function () { ResumeEdit.DeleteInfoClick("Education_edit_" + strcount, 1, 'Education', strEducationID); });
            }
        });
    }
上面就是其中一小段JS代码。

开始的时候

var strEducationID = $($("#" + objformid).find("#hid_EducationID")).val();//这是修改之后的
就是在这行获取数据时出了问题。
原来的这行JS代码是:
var strEducationID = $("#" + objformid+"#hid_EducationID").val();//这是修改之前的
就是这点小小的区别,就在IE6下面获取不到值。在其他浏览器测试都OK的。看来IE6还是比较特别的啊
整体使用下来感觉jquery.form.js真的很不错。以后可以多使用。

posted on 2010-12-03 17:03  朱锋  阅读(5131)  评论(1编辑  收藏  举报

导航