这是我的 PHP 代码_
if(isset($_REQUEST['show']))
{
$con=mysqli_connect("localhost","root","","server_name");
$show = mysqli_query($con, "SELECT * FROM name1 ORDER BY date DESC");
$html='';
while($showE = mysqli_fetch_array($show))
{
$html.= '<h3>'.$showE['un_name'].'</h3>';
$html.= '<div>'.$showE['un_name_dec'].'</div>';
}
echo $html;
//End of while loop
}
这是jQuery代码_
$.post('preprocessor.php', '&show=', function(data) {
$("#accordion").html(data);
$("#accordion").accordion({
collapsible: true,
icons: {
activeHeader: "ui-icon-triangle-1-s",
header: "ui-icon-triangle-1-e"
}
});
});
这是身体_
<div id='accordion'>
</div>
我没有得到实时更新,一切正常,但是 Ajax 的东西不起作用......如果我刷新或重新加载页面但它本身不起作用