Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript Write Another Program

Jamie Brennan
Jamie Brennan
1,207 Points

I can either get task One or task Two to work but not both together. I typed alert("Warning!"); yet it says I didn't

Bet I'm making a silly mistake in my code, but I can't get both to run together in Task Two. If I get Warning! to work, it says Task One can't run. When I get it to run, it says I didn't call the alert function. :( ?

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"></script>
<script>
    alert("Warning!");
  </script>
</body>
</html>

3 Answers

anthony crowell
PLUS
anthony crowell
Courses Plus Student 10,953 Points

Hi, I think the challenge is only asking for one set of script tags in the body, it appears to me that you have two.

Exactly. Jamie, when it comes to challenges, only do what the challenge asks you to do. You shouldn't add in any extra unnecessary code to the challenge such as the line:

<script src="scripts.js"></script>

Delete that line from the challenge as it does not belong.

Jamie Brennan
Jamie Brennan
1,207 Points

Thank you Anthony and Marcus, it works now. :)

You're welcome, Jamie!