Forum Moderators: open

Message Too Old, No Replies

redirection using alert box

         

Ananthi

2:00 pm on Jan 11, 2007 (gmt 0)

10+ Year Member



to redirect page when i click ok button in alert box

Fotiman

3:36 pm on Jan 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is this a question?

mehh

6:26 pm on Jan 11, 2007 (gmt 0)

10+ Year Member



<script type="text/Javascript">
var url="http://www.somesite.com";
var redirect=confirm("Do you want to be redirected to "+url);
if(redirect)
{
window.location=url;
}
</script>

cmarshall

1:05 pm on Jan 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



window.location=url;

Should be: [w3schools.com]

window.location.href=url;

or:

window.location.assign(url);

mehh

5:50 pm on Jan 12, 2007 (gmt 0)

10+ Year Member



sorry. I usualy use PHP to redirect

cmarshall

6:13 pm on Jan 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, I think your method works, just not in all browsers.