时间:2020-10-29 11:09:26 | 栏目:JavaScript代码 | 点击:次
如下所示:
<input id="hd_referrer" type="hidden" /> <a href="javascript:void(0)" onclick="referurl(); ">返回 </a> <script> $(function () { $("#hd_referrer").val(document.referrer); }); function referurl() { var ref = $("#hd_referrer").val(); if (ref != "" && ref != "undefined") { location.href = ref; } else { location.href = history.back(-1); } } </script>