I had tried to use alert, prompt and result:
- If I open html file (address bar: file:///C:/..../index.html), it worked, a dialog box appeared.
If I place html file, javascript file at webapps folder of Tomcat, and open index.html via localhost:8080, it didn't work.
An error: Uncaught TypeError: Property 'alert' of object [object Window] is not a function
Why and how to fix it?