Yahyaotaif Yahyaotaif - 3 months ago 21
Javascript Question

hiding window.location URL

I'm new to the JavaScript thing. I have this script, all I need is to hide the url because it shows up in the message. if you look at window.location, you see the url that i want to hide in the prompt message, then the user will be redirected to that url.

<script>
function confirmation() {
var answer = confirm("Are You sure You want to cancel?")
if (answer){
alert("No information saved!")
window.location = "http://www.google.com";
}
else{
alert("You may hit save to submit information")
setTimeout('confirmation()',10000);
}
}
</script>

Answer

Javascript wont let you do that.

You can use the jQuery custom dialog box. Check the example here

Comments