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 trialVisaal Sivakumar
935 PointsTrying to combine a JavaScript file with an html file...
I get this error:
Uncaught SyntaxError: Unexpected token {
I don't know what I'm doing wrong.
Visaal Sivakumar
935 PointsThis is my "index.html" file:
<!DOCTYPE html>
<html lang="en">
<head>
<title> Introduction to Programming </title>
<style>
html {
background: #FAFAFA;
font-family: sans-serif;
}
</style>
<script src="myscript.js"></script>
</head>
<body>
<h1>Introduction to Programming</h1>
<h2>with JavaScript</h2>
</body>
</html>
Visaal Sivakumar
935 PointsThis is my "myscript.js" file:
console.log("Hello from myscript.js");
console.log{"Hello again!")
Visaal Sivakumar
935 PointsThis is my "myscript.js" file:
console.log("Hello from myscript.js");
console.log{"Hello again!")
1 Answer
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsOn your second console.log, instead of ( you have {
Visaal Sivakumar
935 PointsOh wow...I feel sooooooo dumb. Thank you soo much!
Nicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsNicholas Olsen
Front End Web Development Techdegree Student 19,342 PointsPlease post your code