window.location doesn't seem to work
- From: menkaur <menkaur@xxxxxxxxx>
- Date: Sat, 28 Nov 2009 02:24:06 -0800 (PST)
Hey, guys!
I'm new to javascript, and i've got a problem with one of the simple
functions.
I am trying to redirect a user after he presses a button. Here is the
code:
<form method="post"
name="form2"
action="">
<center>
<label><input id="getRecomendation"
value="Get my recomendation"
type="submit"
name="getRecomendation"
onclick="giveRecomendation()">
<script type="text/javascript">
function giveRecomendation()
{
window.location = "foo.html";
//alert(window.location);
}
the page is run in Firefox from local hard drive.
if alert(window.location) is uncommented, everything works just fine.
but if i comment it, nothing happens.
what's wrong?
.
- Follow-Ups:
- Re: window.location doesn't seem to work
- From: Asen Bozhilov
- Re: window.location doesn't seem to work
- From: David Mark
- Re: window.location doesn't seem to work
- Prev by Date: Re: Can script determine if window.onload has already fired?
- Next by Date: Re: alert and pop-up blockers
- Previous by thread: moves
- Next by thread: Re: window.location doesn't seem to work
- Index(es):
Relevant Pages
|