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 trialDevin Kelly
7,343 PointsChallenge Task 3 of 3 Call the new sayHi function you just created.
Everytime I submit the answer to the 3rd question of this quiz I receive the "Oops, communication error". I'm almost finished with the prerequisites but am afraid I might not finish due to this error! HELP!
function sayHi() {
alert("Hi");
sayHi();
}
<!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"></script>
</body>
</html>
3 Answers
Deborah Bamidele
3,240 PointsHi Devin. The problem is that you are calling the function inside the function itself. What you should do is call it outside the function block.
function sayHi() { alert("Hi"); }
sayHi();
Deborah Bamidele
3,240 PointsYeah. I guess there are tests in place that parses the code and makes sure the answer is correct, otherwise it throws an error.
Million Asseghegn
3,845 Pointsfunction sayHi() { alert("Hi"); } sayHi();
Devin Kelly
7,343 PointsDevin Kelly
7,343 PointsYep, just figured that out and it passed. Weird that it kept making the page lose connection though, right?