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 trialBrandy Mackey
3,309 PointsScripts
What am I doing wrong?
Inside the script tags, write a function that will open an alert dialog with the message Warning? (in case you can't see my code)
<script src ="scripts.js"></script> <script src= "apps.js"> </script> <script> alert ("Warning"); </script>
^^^^This tells me ? 1 is no longer correct but produces an alert warning box. ^^^^
<script src= "scripts.js"> </script> <script> alert ("Warning") </script>
^^^^I believe this one reported a syntax error^^^^
2 Answers
Edgar Gil
13,322 PointsMaybe try alert without the space ex: alert ("Warning"); //-> This is what you show us. alert("Warning"); //-> you should try this.
If is asking you to make a alert function then try that code below.
function myFunction () { alert("Warning"); }
Hope this help. Good luck!.
Roy Penrod
19,810 PointsHere's the code I used to pass the challenge:
<script>
alert("Warning!");
</script>
It passes the challenge with or without the semi-colon at the end, but you should get in the habit of ending every JavaScript statement with the semi-colon.
David Abel
5,199 PointsDavid Abel
5,199 PointsIf your alert is inside the script tags: <script> alert("Warning!") </script>
it should have worked (with or without the exclamation mark).