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,778
  • 10
  • 38
  • 58
Robert Rocha
  • 9,510
  • 18
  • 69
  • 121

1 Answers1

3

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

Tholle
  • 97,067
  • 19
  • 174
  • 171