This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Animate Your Name Forum

View Course » View Exercise

373 points
E46f33ee3e13dac3e0df0185f998d2cc?s=140&d=retro
Submitted by
Ignacio Juan Diaz
over 3 years ago

1/15 ReferenceError: drawName is not defined

In the first exercise "Preview" shows "ReferenceError: drawName is not defined".
I don't change anything. I reset the code and refresh the web, but nothing. Just appears the same error.

main.js

var myName = "Codecademy";

var red = [0, 100, 63];
var orange = [40, 100, 60];
var green = [75, 100, 40];
var blue = [196, 77, 55];
var purple = [280, 50, 60];
var letterColors = [red, orange, green, blue, purple];

drawName(myName, letterColors);

if(10 < 3)
{
bubbleShape = 'square';
}
else
{
bubbleShape = 'circle';
}

bounceBubbles();

index.html

<!DOCTYPE html>
<html>
  <head>
    <script type="text/javascript" src="//code.jquery.com/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/alphabet.js"></script>
  </head>
  <body>
    <canvas id="myCanvas"></canvas>
    <script type="text/javascript" src="http://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script>
    <script type="text/javascript" src="main.js"></script>
  </body>
</html>

If anyone knows what the problem is please answer. Thanks.


2 votes

permalink

In the html tab, the code originally specified an "http://" address for the s3.amazon urls, giving me the reference error mentioned. Changing the urls for the alphabet.js and bubbles.js libraries to start with "https://" solved the problem, for me at least.

1334 points
5f89d247c741496d2f6d69a09fa286b1?s=140&d=retro
Submitted by
Bravo0430
about 3 years ago

1 Comment

9f53374bfbd80053c4aada459add8620?s=140&d=retro nwcarpenter over 2 years ago

thanks! adding in the "s" worked for me as well


2 votes

permalink

I have the same problem with Chrome. I allowed the script, but still does not work.

471 points
Picture
Submitted by
Amanda M Essenmacher
almost 3 years ago


1 vote

permalink

Hi Ignacio, this does not happen on my machine. Could you give some details on what operating system and browser you are using please?

3698 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
over 3 years ago

3 Comments

E46f33ee3e13dac3e0df0185f998d2cc?s=140&d=retro Ignacio Juan Diaz over 3 years ago

I'm using Chrome ( VersiĆ³n 36.0.1985.125 m)also prove it on Internet Explorer 11, and my OS is Windows 7 Professional 64 bits.

55df2afa95e3787b9200005e_359368177 Judy over 3 years ago

That is what I'm using as well. I will have to think about what else I can suggest.

0a4f359b89f3e96bdfcaec30a68e33a0?s=140&d=retro 5733p about 3 years ago

I get the same problem using Firefox on Windows 7 Pro 64bit


1 vote

permalink

Make sure you allow javascript from https://s3.amazonaws.com and http://s3.amazonaws.com. When I had javascript blocked for those sites through the NoScript add on for Firefox, I got the error. As soon as I allowed scripts from that site, the error went away.

511 points
0a4f359b89f3e96bdfcaec30a68e33a0?s=140&d=retro
Submitted by
5733p
about 3 years ago

1 Comment

55df2afa95e3787b9200005e_359368177 Judy about 3 years ago

Nice find!