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 trial

CSS jQuery Basics (2014) Creating a Spoiler Revealer Perform: Part 2

Ying Liang
Ying Liang
2,403 Points

why it doesn't work on my browser? it doesn't show the button.

I just launched the workspace and preview it. But there is no button but just "Darth Vader is Luke Skywalker's Father! Noooooooooooo!" I have tried both chrome and safari. But both are not working. They don't show the button~

Allison Davis
Allison Davis
12,698 Points

If it's not working in either browser the most likely explanation is that there's an error in your code - post it here and we can help troubleshoot!

Carol Dew
Carol Dew
5,923 Points

It doesn't show in mine using Chrome on a Mac, either. The contents of the app.js file are not being loaded; when I check the "sources" in the developer tools, that file is empty. However, it works in FireFox. (Using the Workspace on both browsers.)

I found it worked to not use Workspaces for this course. Personally I'm not a fan of workspaces as the limitation of Australian internet just can't keep up with it so I go old school and follow along with the videos with Sublime Text and everything works perfectly!

1 Answer

Rossella Rosin
Rossella Rosin
15,734 Points

Have you used Developer Tools to debug the problem? I had the exact same problem, and on exactly the same browser and platform until I realized I had forgotten the parenthesis after function. That is I wrote function {} instead of function(){}

in the middle of code it's easy to miss

$("button").click( function {
  //  3.1 Show spoiler
                  $(".spoiler span").show();
  //  3.2 Get rid of button
                  });
$("button").click( function() {
  //  3.1 Show spoiler
                  $(".spoiler span").show();
  //  3.2 Get rid of button
                  });

but Developer Tools warned of a sintax error on the function line.

I fixed it and now the code works properly. Do the same and you'll discover there must be a similar problem with your code.