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

General Discussion

Why isn't my index.html linking to my javascript?

Hello,

I just purchased a Chromebook and all of my files are now on Google Drive. In one of my folders, I have an index.html file and user.js file, which should be linked as you see below.

            <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
            <script src="user.js" type="text/javascript" charset="utf-8" ></script>

As you see, I am also linking to jquery. When I open the index file in the browser, the the user.js is not being loaded. The jquery is.

Anybody out there who can explain this? Like I said, the two files are in the same folder....

2 Answers

Can you try to remove the extra attributes in the jquery file and see if it works? like instead of

 <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
 <script src="user.js" type="text/javascript" charset="utf-8" ></script>

try making it

 <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
 <script src="user.js" type="text/javascript" charset="utf-8" ></script>

Hi Gloria,

I actually just moved the jquery altogether because I am just using pure JS, and I still have the problem. For some reason, the browser isn't making the http request to get my script.

Hi Ryan, was it working before? Can you show us your code?