Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 88
  • Last Modified:

HTML5 and Javascript

I'm trying to run javascript on my HTML page and it seems not to be working at all.  

I've uploaded the project.  I'm going by pluralsight and going along with a course there.  I added the jquery which was not included in the pluralsight but the canvas is not working.

If you remove the .txt extension you will get the zip file.
Proj2.zip.txt
0
CipherIS
Asked:
CipherIS
2 Solutions
 
Brian TaoSenior Business Solutions ConsultantCommented:
2 problems:
  1. You have a typo in Script.js.  You had addEventListender (an extra "d") where it should be addEventListener.
  2. jcanvas needs jquery, so you have to include a line for it in the <head> section of your canvas.html, e.g.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

Open in new window

0
 
leakim971PluritechnicianCommented:
in you file script.js replace :
addEventListender("load", initiate)
by :
addEventListener("load", initiate);

also you posted the version without the jQuery plugin you said you added line 7 :

<!DOCTYPE html>

<html lang="en">
    <head>
        <meta charset="utf=8" />
        <link rel="stylesheet" href="mystyle.css" />
        <script src="js/jquery.min.js"></script>
        <script src="js/jcanvas.min.js"></script>
        <script src="js/script.js"></script>
        <title>Canvas Demo HTML5</title>
    </head>
    <body>
        <div>
            <p>Canvas</p>
        </div>
        <section id="CanvasSection">
            <canvas id="canvas" width="500" height="300"></canvas>
        </section>
    </body>
</html>

Open in new window


https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
0
 
CipherISAuthor Commented:
Thanks.  Can't believe I didn't see the typo.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now