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

Simon Nordström
Simon Nordström
492 Points

How do i fix the javascript?

I have tested putting the code in multiple places and adding the <script> signs once more, though it seems to always say that i didnt call the alert function inside the script signs. 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 src="scripts.js"> alert("Warning");
  </script> 

  </body>
</html>

2 Answers

Alexandra Barnett
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi Simon! Very close! Firstly, you don't need to like to a js file so the src attribute isn't required. Secondly, you just need at exclamation mark after warning - when writing strings in the code challenges, they have to be identical to what they put in the question otherwise you will get an error:

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

Hope that helps! Let me know if you have any questions :)

Ari Misha
Ari Misha
19,323 Points

Hiya Simon! If you'd go through challenge again , it said you have "alert" the user saying "Warning!". Notice the exclamation? Thats what your code lacks. Add an exclamation to "Warning" and you're good to go. (: