Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

How to redirect in javascript ?

Hi all,

I am brandnew with javascript... but: learning !

I have the following code:

var m_D = confirm('blablabla');
if (m_D==true) {
HERE I WANT TO GO TO ANOTHER PAGE
}

What is the code to go to another page?
I found out that it is not : response.redirect and not location.href.

Help is appreciated(), Ger.
[378 byte] By [GerEielts] at [2007-11-11 7:00:26]
# 1 Re: How to redirect in javascript ?
Hi all,

I found the answer:

location.href = " http://www.domain.com";
or
location.href = "page.html"; // if same domain and directory

greetings, Ger.
GerEielts at 2007-11-11 22:39:41 >