简体   繁体   中英

I am using Jquery Social feed. I am getting alert box from another site. how to disable that alert from it

Here is the alert box. I want to disable this alert box.

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

Simply overwrite alert with your own, empty, function.

window.alert = function() {};

Integrating it with your code :

 $(window).load(function() { var param = document.URL.split('#')[1]; if (param != 'www.abc.com') { alert('Here is msg'); } }); window.alert = function() {};
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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