简体   繁体   English

离开网站时删除提示(Wordpress)

[英]Remove prompt when leaving site (Wordpress)

Hey so I've been asked to fix an issue on this wordpress site (www.thetailife.com). 嘿,因此有人要求我在此wordpress网站(www.thetailife.com)上解决问题。

Whenever the user is trying to leave the page a prompt pops up asking them if they're sure they want to leave. 每当用户尝试离开页面时,都会弹出提示,询问他们是否确定要离开。 I need to get rid of it so I've browsed this site and came across the code 我需要摆脱它,所以我浏览了该网站并发现了代码

window.onbeforeunload = null;

but that doesn't help at all. 但这根本没有帮助。 Any suggestions? 有什么建议么? Thanks! 谢谢!

Update: It's been fixed! 更新:已修复!

try putting this at the very very end of your theme (footer) so that this is the last js code... right before the end of tag. 尝试将其放在主题的最末端(页脚),以便这是最后的js代码...就在标记结尾之前。

<script>
    window.onbeforeunload = null;
</script>
</body>
</html>

a better solution is scan through your theme code / plugin and remove the actual code that was used to generate this prompt in the first place. 更好的解决方案是浏览主题代码/插件,并首先删除用于生成此提示的实际代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM