$(function () { $(".logo button").click(function () { var content = $("#Sou").val(); var type = $("#selectType").val(); if(content.trim().length<2){ layer.tips("请至少输入两个å—符","#Sou"); }else{ if(type=="供应"){ window.location.href="../spzs/?search="+content; }else if(type=="采è´"){ window.location.href="../syjh/qiugou.htm?search="+content; }else if(type=="ä¼ä¸š"){ window.location.href="../qyml/?search="+content; }else if(type=="资讯"){ window.location.href="../hyxx/informationSearch.html?search="+content; }else if(type=="百科"){ window.location.href="../qyfw/encyclopediaSearch.html?search="+content; } } }); getAdb(); }); function getAdb() { $.ajax({ url:url+"/tbgj/tbgj/listForPage", data:{}, type:"get", dateType:"jason", async:true, success:function (response) { var table1 = "<tr><th>ä½ç½®</th><th>月付</th><th>åŠå¹´ä»˜</th><th>年付</th><th>è§„æ ¼</th></tr>"; var table2 = "<tr><th>ä½ç½®</th><th>月付</th><th>åŠå¹´ä»˜</th><th>年付</th><th>è§„æ ¼</th></tr>"; $.each(response,function (i, list) { if(i==4){ table1+="<tr>" + "<td class='td-kuan'>"+list.position+"</td>" + "<td class='td-kuan'>"+list.month+"</td>" + "<td class='td-kuan'>"+list.half+"</td>" + "<td class='td-kuan'>"+list.year+"</td>" + "<td class='td-kuan'>"+list.size+"</td>" + "</tr>"; }else{ table2+="<tr>" + "<td class='td-kuan'>"+list.position+"</td>" + "<td class='td-kuan'>"+list.month+"</td>" + "<td class='td-kuan'>"+list.half+"</td>" + "<td class='td-kuan'>"+list.year+"</td>" + "<td class='td-kuan'>"+list.size+"</td>" + "</tr>"; } }); console.log(table1); console.log(table2); $("#tb1").html(table2); $("#tb2").html(table1) }, error:function (e) { console.log(e.status); console.log(e.responseText); } }); }