I am getting a really weird JavaScript error when I run this code:
If you want to return some value then wrap your statement in function
function my_function(){
return my_thing;
}
Problem is with the statement on the 1st line if you are trying to use PHP
var ask = confirm ('".$message."');
IF you are trying to use PHP you should use
var ask = confirm (); //now message with be the javascript string!!