Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable alert(); [duplicate]

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

like image 217
specked Avatar asked Dec 08 '10 13:12

specked


People also ask

How do I turn off message alerts?

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.

Does JavaScript alert stop execution?

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.


1 Answers

Simply overwrite alert with your own, empty, function.

window.alert = function() {};  // or simply alert = function() {}; 
like image 156
Andrew Moore Avatar answered Sep 22 '22 10:09

Andrew Moore