解决方案 »

  1.   

    你的getAjax改异步的试试。生成树和添加事件的代码放回调里面
            $(function () {
                $("#Department").focus(function () {
                    var html = "";
                    getAjax('WMS_OrdersForm.aspx', 'action=LoadTree', function (rs) {
                        html = rs;  
                        combotree("Department", $("#Department").width() + "px", "200px", html);
                        $(".strTree li div").click(function (e) {
                            if (!$(this).hasClass("hitarea")) {
                                $("#DepartmentId").val($(this).attr('id'));
                                $("#Department").val($(this).find('span').html());
                                $("#div_treeshow").hide();
                            }
                            else { e = e || event; e.stopPropagation ? e.stopPropagation() : e.cancelBubble = true; }
                        })

                    });
                })        });function getAjax(url, parm, callBack) {
        $.ajax({
            type: 'post',
            dataType: "text",
            url: url,
            data: parm,
            cache: false,
            ////////async: false,

            success: function (msg) {
                callBack(msg);
            }
        });
    }
    同步你的html应该是有值的,怎么感觉是没有获取到值。。