当查询结果返回时,将页面加载到包含MySQL查询代码的div,可以通过以下步骤实现:
<div id="queryResult"></div>
// 使用jQuery的例子
$.ajax({
url: '后端接口地址',
method: 'GET',
success: function(response) {
// 将查询结果加载到div中
$('#queryResult').html(response);
},
error: function(error) {
console.log(error);
}
});
请注意,以上答案仅供参考,具体实现方式可能因具体技术栈和需求而有所不同。
领取专属 10元无门槛券
手把手带您无忧上云