异步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>"; } });
作者:大胖儿在努力
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。