>function TestMsg() >{ > alert('Test Message'); >} >>everything works. In the javascript, before the above function is written, I can call:
>TestMsg(); >>and Alert shows the message.
><script type="text/javascript"> >function TestMsg() { > alert('test message'); >} ></script> >>I check in the Chrome that the file dmitry.js is loaded. But when I call TestMsg(); in the javascript, nothing alerts.
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <script type="text/javascript" src="dmitry.js"></script> <button onclick="TestMsg()">Click me</button> </body> </html>and Dmitry.js:
function TestMsg() { alert('test message'); }