1

I have something simple. I have an html file and JavaScript file. In the JavaScript file the simple alert() function is called but, it does not work!

I wrote a second line in the JavaScript file to make sure I was not giving the incorrect path console.log() and it works as expected.

HTML:

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Demo</title>
</head>
<body>

    <div id="container">

    </div>

    <script src="functionality.js"></script>
</body>
</html>

In external JavaScript file:

alert('hello'); // does not get executed
console.log( 'hello' ); // gets executed

Why this does not work?

shershen
  • 9,875
  • 11
  • 39
  • 60
Robert
  • 10,126
  • 19
  • 78
  • 130

1 Answers1

3

You have probably pressed "prevent this page from creating additional dialog" in your Chrome browser. Try restarting it.

Tholle
  • 108,070
  • 19
  • 198
  • 189