M
menkaur
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?
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?