如何为 jQuery load() 内容制作自定义后退按钮

问题描述

在我的一个 php 页面 (Report.php) 中,我通过 jQuery load() 加载其内容。我想在我的 php 页面上创建一个“后退按钮”,以便我的用户可以单击它返回页面。 注意- 我不是在寻找浏览器后退按钮。

这是我的 php 页面 -

report_template.php

//This page query my database and creates a content table<br>
//Table content
<a href="#" onclick="fetchReport(<?php echo $row['report_id']; ?>);">Another Report Link</a>

report.php

<button>Go Back</button> //This button will take user to back (equivalent to window.history.back() )
<div id="rept"> </div>

<script>
jQuery('#rept').load('report_template?id=1');
 
function fetchReport(id){
 jQuery('#rept').load('report_template?id='+id);
}
</script>

我的 jquery/javascript 水平一般。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)