my problem in running javascript !
hello everyone i want when i click on ok. my code call ExitMassage function ,so i see goodbay massage but i cann't see this result. <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body onload="exit()"> </body> <script> function exit() { var x = confirm("do you want exit?"); if (x == true) { ExitMassage('alireza', 'Babaei') function ExitMassage(FirstName, lastName) { document.write = (' Good bay ' + FirstName + lastName); } } else document.URL = '#'; } </script> </html>