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 trialEwerton Luna
Full Stack JavaScript Techdegree Graduate 24,031 PointsNo preview and the console is not acusing any errors
I wrote this bit of code and tested it
alert("Let's do some math!");
var first = prompt("Please, type a number");
first = parseFloat(first);
var second = prompt("Please, enter a second number");
second = parseFloat(second);
var header = "<h1>Math with numbers " + first + " and " + second + ".</h1>";
document.write(header);
I already linked the file to the webpage, but it wont display anything, not even the alert. The console is empty, not showing any messages.
3 Answers
KRIS NIKOLAISEN
54,971 PointsThat will work. In your index.html you have scr
<script scr="js/math.js"></script>
It should be src
<script src="js/math.js"></script>
Ewerton Luna
Full Stack JavaScript Techdegree Graduate 24,031 PointsI don't know how to post the snapshot, but I will put this link here from it. Let me know if it works! Thanks!
Ewerton Luna
Full Stack JavaScript Techdegree Graduate 24,031 PointsThanks, Kris! It's not the first time I made this mistake lol Oh God. Really appreciate it!
KRIS NIKOLAISEN
54,971 PointsKRIS NIKOLAISEN
54,971 PointsCan you post a snapshot? It is the camera icon in the upper right corner.