JavaScript处理ajax返回的数据
function PoeviewExcel() { $.ajax( { url: "send/index", type: "post", success: function (data) { var divshow = $("#showInfo2"); divshow.text("");// 清空数据 divshow.append(data); // 添加Html内容,不能用Text 或 Val divshow.dialog({ title: "PHP网站开发", height: 250, width: 580 }); } } ); return false; }
将获得的内容插入HTML中:
<a href="#" onclick="return PoeviewExcel()">预览数据</a> <div id="divPreview" style="display: none"> <text id="showInfo2"></text> </div>