异步Ajax--get方式与动态生成数据

$.ajax({
        type: "GET",
        async: false,
        url: RequestAjaxURL,
        data: parms,
        success: function (data) {
            if (data == "") {
                alert("请求服务器异常!");
                return;
            }
            data = $.parseJSON(data);
            var targetStr = isBlank == true ? "target='_blank'" : "";
            html += "<ul>";
            $.each(data, function (index, model) {
                html += "<li><img id='_img" + index + "' src='/Styles/newHomeImgs/menu_icon.gif' width='9' height='9' onclick='imgclick(" + index + ");'/>" + model.RegionInfo.RegionName + "</li>";
                html += "<li id='_li" + index + "' class='wqwq_li1'>";
                $.each(model.Projects, function (index2, model2) {
                    if (href.indexOf("?")>0) {
                        html += "<a id='" + model2.PID + "' onmousemove='movea(this);' onclick='closeshowinfo();' href='" + href + "&id=" + model2.PID + "' " + targetStr + ">" + model2.PName + "</a></br>";
                    }
                    else
                    {
                        html += "<a id='" + model2.PID + "' onmousemove='movea(this);' onclick='closeshowinfo();' href='" + href + "?id=" + model2.PID + "' " + targetStr + ">" + model2.PName + "</a></br>";
                    }
                   
                });
                html += "</li>";
                html += "</li>";
            });
            html += "</ul>";
        }
    });

 

posted @ 2017-07-25 17:28  大胖儿在努力  阅读(175)  评论(0)    收藏  举报