PDA

View Full Version : redirect page



mir4kir
10-11-2008, 09:52 AM
is there any script when page refresh its redirect to an other page?

rangana
10-11-2008, 10:23 AM
How does your page gets refreshed? via meta tag or another JS function?

Anyway, you can use:


location.href='http://www.google.com'


Hope that helps.

Get back if you're still stumped.

mir4kir
10-11-2008, 04:57 PM
when people click on refresh button or press f5 then it can be redirect?how can i?

rangana
10-12-2008, 02:39 AM
When people press F5, you can redirect it to another page, but not when the refresh button is pressed:


<script type="text/javascript">
window.onload=function()
{
document.onkeydown=function(event)
{
var keyCode=event.keyCode?event.keyCode:event.which?event.which:event.charCode;
if(keyCode==116) // If F5 is pressed
location.href='http://www.google.com'; // Redirects to another URI
}
}
</script>


Hope that helps.

mir4kir
10-12-2008, 08:25 AM
if a have auto refresh page script then i can redirect?or can i disable refresh button?