Problem with code [Resolved]


#1

So, just like many others, my code isn't working.
When I click the .html file, it opens up a blank window

Different from the others, I have added http: to the jQuery and such, but I can't find the problem

index.html

<!DOCTYPE html>
<html>
  <head>
    <script type="text/javascript" src="http://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>
    <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>

main.js

ivar red = [0, 100, 63];
var black = [0, 0, 0];
var white = [255, 255, 255];

var myName = "Nemo";
var letterColors = [black, red, white];

drawName(myName, letterColors);
bounceBubbles();

#2

@arcplayer13536

== 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="https://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/alphabet.js"></script>
  </head>
  <body>
    <canvas id="myCanvas"></canvas>
    <script type="text/javascript" src="https://s3.amazonaws.com/codecademy-content/courses/hour-of-code/js/bubbles.js"></script>
    <script type="text/javascript" src="main.js"></script>
  </body>
</html>

== main.js ========================

var myName = "Leonhard";
var letterColors=[red,orange,green,blue,purple];
if (myName.length<13){
var bubbleShape="square";
}
else {
var bubbleShape="circle";
}
drawName(myName, letterColors);
//bounceName();
bounceBubbles();

#3

Hi BlackHyp3r,

Your code is fine except for one thing - you're missing the canvas for the computer to draw on :slight_smile:

Add this at the beginning of your <body>, and it should work:

<canvas id="myCanvas"></canvas>

#4

Thanks! I got it to work now, my solution was partially that I forgot the canvas and partially that I wrote http:// instead of https://


#5

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.