简体   繁体   English

Opencart模板中的错误警报消息

[英]Error Alert message In Opencart Template

I am Working on Project on opencart project and its about to Complete.I am Having One Problem now.when ever user click on other Tab open. 我正在处理opencart项目及其即将完成的项目。我现在遇到一个问题。当用户单击其他选项卡打开时。 Java is Displaying a alert ERROR message.It is because internet speed is slow or Page is not properly loaded.Still i want to remove that Message is there any way i can remove it or fix it. Java正在显示警告错误消息。这是因为互联网速度慢或Page未正确加载。仍然我想删除该消息,我可以通过任何方式删除或修复它。 Please help me. 请帮我。 Here is the Link 链接在这里

To block this irritating alert coming on your store, just include below script in your website header. 要阻止此刺激性警报出现在您的商店中,只需在网站标题中添加以下脚本即可。

 <script> (function() { var new_alert = window.alert; window.alert = function(str) { //str variable return content which is passed to be shown in alert str1 = str.replace(/(\\r\\n|\\n|\\r)/gm,""); //Removing line break from string if (str1 !="error"){ //show alert only if content is not equal to 'error' new_alert(str); } else{ // do nothing } }; })(); </script> 

If you are wondering what it does: It just replaces default alert function of javascript and don't show alert when its content is 'error'. 如果您想知道它的作用:它将替换javascript的默认警报功能,并且当内容为“错误”时不显示警报。

简单地通过使用覆盖警报

<script>window.alert = function() {};</script>

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

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