Solved

HTML5 and Javascript

Posted on 2016-10-17
3
36 Views
Last Modified: 2016-10-18
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
Comment
Question by:CipherIS
3 Comments
 
LVL 9

Accepted Solution

by:
Brian Tao earned 250 total points
ID: 41847718
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
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 250 total points
ID: 41847731
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
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 41848250
Thanks.  Can't believe I didn't see the typo.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now