PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 16, 2022

[FIXED] How do I prevent, stop, or kill JavaScript function?

 October 16, 2022     dom, dom-events, javascript     No comments   

Issue

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


Solution

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;};


Answered By - Khodor
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing