ajax

 function bindWD() {
        var row = $('#zydg').datagrid('getSelected');
        if (row == null) { return; }
        $.ajax({
            type: "post",
            url: "/ProjectCbk/GetFilesJson",
            //                dataType: "xml",
            data: { xmid: xmid, lcbm: lcbm, fazylbmc: row.FAZYLBMC },
            async: false,
            success: function (data) {
                //文档附件
                var data1 = [];
                var data3 = eval(data);
                for (var i = 0; i < data3.length; i++) {
                    //data1.push('<div>' + data3[i].FJMC + '</div>');
                    data1.push('<div id="{0}" class="filesid"><a id="s{0}" class="files" href="{2}">{1}</a><a class="delFile" href="#" onclick="delUploadFile(\'{0}\',\'{1}\')">删除</a>&nbsp;&nbsp;&nbsp;<b id="b{0}"></b></div>'.format(data3[i].FJID, unescape(data3[i].FJMC), unescape(data3[i].CFDZ)));
                }
                //alert(data1.join(""));
                $('#filelist').html(data1.join(""));
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert(errorThrown);
            }
        });
    }

posted @ 2016-06-07 16:36  update_  阅读(434)  评论(0编辑  收藏  举报