Javascript help
Hi,
I am including some Javascript in my Dreamweaver file an everything is being executed just fine except for the bit of code that changes the URL of the main page (document.location). Can you please explain why this one specific line is not working? It works for other people, according to some examples. Is there another way to make my page go to another url?
Here is my code:
<script type="text/javascript">
<!--
function confirmation() {
var answer = confirm("Leave?")
if (answer){
alert("Bye bye!")
window.location = "http://www.google.com/"; //this does not work!!
}
else{
alert("Thanks for sticking around!")
}
}The alert lines work, so function is working, but when it comes to going to the url, no dice. I have tried redirecting to another file on my server, also does not work. I have tried other commands, and they dotn work either. what is the appropriate code to use?
Thank you.