Solved

HTML5 and Javascript

Posted on 2016-10-17
3
71 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Suggested Courses

622 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