Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
129
rated 0 times [  132] [ 3]  / answers: 1 / hits: 32692  / 12 Years ago, tue, march 13, 2012, 12:00:00

How do I prevent this JavaScript function from executing.


I have a js function that is causing a serious issue and I am not able to remove nor modify it source. I would like to know if it is possible to simply prevent, stop, or kill the function in order that it is not executed till I resolve the issue.


So somewhere inside the page:


<script type="text/javascript"><!--
problem_func();
//--></script>

And all I want is to stop that function from execution placing a stopper inside the header or external js.


Any advice?


HERE IS THE LIVE EXAMPLE, HOW TO STOP THAT? http://jsbin.com/uxalag/3


More From » dom

 Answers
30

If you know the function name, you can replace it with a function that does nothing.
After the script tag of the source js file use this:



window.FunctionName=function(){return false;};

[#86877] Monday, March 12, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ammonderekm

Total Points: 247
Total Questions: 105
Total Answers: 98

Location: Tuvalu
Member since Sat, Feb 11, 2023
1 Year ago
;