1, tambah butang carian baharu dalam papan mesej
<?php <div>搜索:<input id="con" name="sousuo"><input id="sousuo" type="button" value="确定"></div>
tambah kod js:
<?php $("#sousuo").click(function () { str=""; var con=$("#con").val(); $.get("messageshowdb.php?content=sousuo",{con:con,page:page,num:num},function (data) { $.each(data, function(key,value) { str+="<div>"+[key]+":"+"标题:"+value.title+"-----"+"内容:"+value.content+"</div>"; $("#div1").html(str); }); },"json") showpage(); })
2, ubah suai fail messageshowbd.php:
kod berikut:
:
3, Paparan kesan:
🎜bahagian seterusnya