Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Introducing JavaScript Write Another Program

Kiran Varma
Kiran Varma
2,861 Points

task 1 is no longer parsing

error says task 1 is no longer parsing but when i check task 1 it is correct. Not sure where the problem is! could someone please help..

index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
  <script>
    function() {
      alert("Warning!");
    }
  </script>
</body>
</html>

1 Answer

Hi Kiran,

The challenge is asking you to call a function that will open an alert dialog box. If you wrap it inside of an anonymous function like you have here, then no code is actually ever being called. Since alert() itself is a function (a method of the Window object), you simply need:

<script>
    alert("Warning!");
</script>

Hope that helps.

Happy coding!
Leslie