Hi
I am trying to stop redirecting the webpage to another. This is the code to <script type="text/javascript">
if(window.top.location.href!="url")
window.top.location.href ="url";
</script>
My Question is How I can stop this redirecting to another page? Could anybody help me on this. I know there is one option that I can use this option: Are you sure to navigate from this page code? But Is there any option to stop redirecting the webpages?
Thanks in advance
12 replies to this topic
#1
Posted 06 January 2011 - 11:19 PM
|
|
|
#2
Posted 06 January 2011 - 11:37 PM
ehm.. remove that code, and it stops redirecting?
#3
Posted 06 January 2011 - 11:39 PM
But, How can we stop redirecting the webpages with the above code in? Is there any code to use it on our webpages?
#4
Posted 06 January 2011 - 11:39 PM
But, How can we stop redirecting the webpages with the above code in? Is there any code to use it on our webpage?
#5
Posted 06 January 2011 - 11:39 PM
Well, you could disable javascript in the webbrowser.
#6
Posted 06 January 2011 - 11:42 PM
I know there is a code to stop this: <script type="text/javascript">
window.onbeforeunload = function () {
return "This will end your session";
}
</script>
But when anybody opens the page, it will ask are you sure to navigate away. But Is there any other alternative to stop?
window.onbeforeunload = function () {
return "This will end your session";
}
</script>
But when anybody opens the page, it will ask are you sure to navigate away. But Is there any other alternative to stop?
#7
Posted 06 January 2011 - 11:43 PM
Note: I have moved your thread to JavaScript forum, Java is not JavaScript.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#8
Posted 06 January 2011 - 11:45 PM
Thanks
#9
Posted 06 January 2011 - 11:49 PM
Can Anybody answer the above question. Please?
#10
Posted 07 January 2011 - 03:19 AM
It's late, I've been drinking, so my logic might be fuzzy, but have you tried placing the code within some other code? Or are you trying to sidestep something that checks whether the code is in there? If it will only check the source code, try placing it within HTML comments vel sim.
Something witty here.
#11
Posted 07 January 2011 - 03:47 AM
Hi
Could you please give an example, How I can place it HTML comments.
Could you please give an example, How I can place it HTML comments.
#12
Posted 07 January 2011 - 07:23 AM
I dont really know any JS but couldnt you go:
<script type="text/javascript"> if(window.top.location.href!="#") window.top.location.href ="#"; </script>
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.
Science is only an educated theory, which we cannot disprove.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









