wap手机端解决返回上一页,js

 <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>

原文地址:https://www.cnblogs.com/qigege/p/5151564.html