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

JavaScript jQuery Basics (2014) Creating a Spoiler Revealer Perform: Part 1

Kartik Shetty
Kartik Shetty
4,914 Points

Javascript script not running

Hi!i am doing my course in JQuery. I am having issue running my JS script file which includes JQuery. I have added the script file at the end and and script to include the JQuery libraries is also included. I have noticed that I am using the right order. First I am using the script tag to include the JQuery packages and then i am using script tag to include the JS file. Could anyone help me?

If you could post your code it would be asier to help you out. Just copy/paste it in.

Steve.

5 Answers

Have you tried removing the space before spoiler?

My workspace has this in it:

script.js
$(".spoiler span").hide();
Kartik Shetty
Kartik Shetty
4,914 Points

It had only one statement- $(. spoiler).hide(). I am not getting any error too

Bob McCarty
PLUS
Bob McCarty
Courses Plus Student 16,618 Points

Kartik,

I suggest you look for errors in the developer console. Run the page. Open the browser's developer tools. Look in the console tab.

Bob

Theo Messenger-Jones
Theo Messenger-Jones
8,810 Points

Looks like somethings going on with workspaces. If you refresh the preview page a couple of times it should run.