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 trialArman Stephens-Dabney
457 PointsI’m stuck.
I wonder if it is asking me to repeat the same exact step that i already did.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js" >
alert("Warning");
if
</script>
</body>
</html>
3 Answers
Steven Parker
231,271 PointsThere are two kinds of "script" tags. One kind has a "src" attribute that names an external file to be loaded and run. That kind should not have any code between the start and end tags.
The other kind does have code between the tags, but it does not have a "src" attribute in the start tag. That's the kind you need for this particular challenge. And as Brendon observed, that stray "if" shouldn't be there:
<script>
alert("Warning");
</script>
Øyvind Andreassen
16,839 PointsCould you please be more specific? Are you submitting the code you attached and getting an error, and is this regarding the code challenge on "Write another program" because that challenge doesn't require you to include an external script, but the next challenge does.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsYou've already done it, just get rid of if
.