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 - what is jquery example

Workspaces doesn't run the commands in my js file. I simply try to run the example in the JQuery basics - what is jquery video. index.html and app.js are the only files . But the commands in app.js doesn't work. When I copy the same commands to index.html, it works fine. Is it a bug related to chrome or sth else? I couldnt find a solution any help is appriciated.

2 Answers

I might of had a similar problem. Take a look at my community thread below. Maybe this will help, if not please post your code so we can see what the problem is.

https://teamtreehouse.com/community/linking-jquery-to-external-js-file

sorry but the solution didin't work for me. I put the script links to the head. But nothing changed.

This is the index.html

<!DOCTYPE html> <html> <head> <title>Take Evasive Action</title> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" title="no title" charset="utf-8"> </head> <body> <p class="warning"> <span>It's A Trap!</span> </p> <div class="image"> <img src="img/ackbar.gif" /> </div> <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"> </script> <script src="js/app.js" type="text/javascript" charset="utf-8"></script>

<!--//these coomented lines work fine when I open <script> //hide the warning jQuery(".warning").hide(); //show the warning slowly jQuery(".warning").show("slow"); </script>-->

</body> </html>

and this is the app.js

//hide the warning jQuery(".warning").hide(); //show the warning slowly jQuery(".warning").show("slow");

Is this from WorkSpaces or from your own text editor. Also where are your head tags, JS file link tag, and meta tags?

I see you have CSS linked and an img tag.