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

My javascript page wont load

Index.html:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title> JavaScrip Foundations: Arrays</title>
    <style>
      html {
        background: #FAFAFA;
        font-family: sans-serif;
      }
    </style>

  </head>
  <body>
    <h1> JavaScrip Foundations</h1>
    <script scr="Arrays.js"></script>
    <button id="action">Action</button>
    <input id="text_field">
  </body>
</html>

thats my code and in the same folder i have the "Arrays.js" file and when i go and view it, the javascript wont loa any ideas why its not loading my javscript.

heres my Arrays.js :

var my_array = [0, 1, 2, 3, 4, 5, 6];
console.log(my_array.toString());

my_array.splice(2, 1, 'two', 'TWO', 'SOMETHING ELSE');


console.log(my_array.toString());

You have a typo. It "scr" should be "src":

<script src="Arrays.js"></script>

2 Answers

Thank you so much!

I hate to beg, but could you mark my answer as correct? (A certain number of forum points are required for the Treehouse Career Program.)

First you have to submit an answer, you only posted a comment.

You have a typo. It "scr" should be "src":

<script src="Arrays.js"></script>

P.S. Thanks Blake - I didn't know there was a difference between a comment and an answer in the forum.