Yahyaotaif Yahyaotaif - 1 year ago 114
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.

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

Answer Source

Javascript wont let you do that.

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