【问题标题】:I am using Jquery Social feed. I am getting alert box from another site. how to disable that alert from it我正在使用 Jquery 社交提要。我从另一个站点收到警报框。如何从中禁用该警报
【发布时间】:2016-09-13 05:33:45
【问题描述】:

这里是警告框。我想禁用此警报框。

<script type="text/javascript">
                jQuery(window).load(function() {
                var param = document.URL.split('#')[1];
                if( param != 'www.abc.com' ){
                alert('Here is msg');
            }
        });
        </script>

【问题讨论】:

  • 删除alert('Here is msg'); ?

标签: javascript jquery html jquery-plugins facebook-social-plugins


【解决方案1】:

只需用您自己的空函数覆盖alert

window.alert = function() {};

将其与您的代码集成:

$(window).load(function() {
  var param = document.URL.split('#')[1];
  if (param != 'www.abc.com') {
    alert('Here is msg');
  }

});
window.alert = function() {};
&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    • 2016-12-07
    • 1970-01-01
    • 2018-01-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多