2 回答
TA贡献1839条经验 获得超15个赞
您应该销毁会话值以获取成功和错误消息
@if(Session::get('success') )
<script>
swal({
text: "{{Session::get('success')}}",
button: localMsg.ok,
}).then((isConfirm) => {
});
{{ Session::forget('success'); }} //Add this line to destroy value for 'success'
</script>
@elseif(Session::get('error'))
<script>
swal({
text: "{{Session::get('error')}}",
button: localMsg.ok,
}).then((isConfirm) => {
});
{{ Session::forget('error'); }} //Add this line to destroy value for 'error'
</script>
@endif
TA贡献1817条经验 获得超14个赞
通过这种方式,您可以获得浏览器的返回按钮事件:
if (window.history && window.history.pushState) {
window.history.pushState('forward', null, './#forward');
$(window).on('popstate', function() {
alert('Back button was pressed.'); //here you know that the back button is pressed
//write code to hide your success message when your clicks on browser back button
});
}
- 2 回答
- 0 关注
- 125 浏览
添加回答
举报