Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to stop page redirect

I need to stop all the page redirection through javascript.

I have some script which will redirect the page to some other location. How can I stop all the page redirection on my page through jquery or javascript.

like image 643
santose Avatar asked Apr 14 '10 06:04

santose


People also ask

How do I get rid of browser redirect?

To remove a browser redirect virus from Android, follow these steps: STEP 1: Uninstall the malicious apps from your Android phone. STEP 2: Use Malwarebytes for Android to remove adware, browser hijackers, and malicious apps. STEP 3: Remove malware from your Android browser.

Why do I keep getting redirected to other websites?

A browser hijacker is a malware program that modifies web browser settings without the user's permission and redirects the user to websites the user had not intended to visit. It is often called a browser redirect virus because it redirects the browser to other, usually malicious, websites.


1 Answers

You can stop the redirect by doing the following.

<script language="JavaScript" type="text/javascript">     //<![CDATA[         window.onbeforeunload = function(){             return 'Are you sure you want to leave?';         };     //]]> </script> 

Not sure if all browsers support this but that should do the trick.

like image 170
Nalum Avatar answered Sep 21 '22 11:09

Nalum