Solved

HTML5 and Javascript

Posted on 2016-10-17
3
58 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

856 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