Code that is generated on my page that I cannot control contains an alert. Is there a jQuery or other way to disable alert() from working?
The javascript that is being generated that I want to disable/modify is:
function fndropdownurl(val) 1317 { var target_url 1318 target_url = document.getElementById(val).value; 1319 if (target_url == 0) 1320 { 1321 alert("Please Select from DropDown") 1322 } 1323 else 1324 { 1325 window.open(target_url); 1326 return; 1327 } 1328 }
I want to disable the alert on line 1321
Thanks
How to Disable Push Notifications on Android. You can disable push notifications on Android by going into the Settings > Notifications options. Similar to iOS, Android lets you turn off push notifications for individual apps or use a 'Do not disturb' mode.
One of the nice things about the built-in JavaScript alert is that - unlike virtually anything else in JavaScript - it's synchronous. It's completely blocking, and no other code will execute until it's been dismissed.
Simply overwrite alert
with your own, empty, function.
window.alert = function() {}; // or simply alert = function() {};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With