Differense between javascript and javascript drawing and animation


#1

Hey there
I did the JS drawing and animation course at khanacademy and learnt a couple of things there
When I type in the coding box at codecademy for example rect(100,100,100,100); then nothing shows up. Is that normal or can i do animatuion also here

Joe


#2

Where "here" are you putting your code -- in a Codebit? If so then you can share the link so we can see what you are doing.

Here is an example of a Codebit with a rectangle: https://www.codecademy.com/AlbionsRefuge/codebits/Dmwlit


#3

Hello @albionsrefuge
I just did at khanacademy drawing and animation
I am just doing javascript here as well but when i insert for example rect(100, 100, 100, 100); then it doesn't draw a rectangle in the javascript box in this course
joe


#4

The thing is, @jo_jo2000 this isn't really JavaScript. Its more like jQuery, and I don't know if it's really in it. Like the ellipse, rect, whatever, I don't think that's even in JavaScript! Maybe in jQuery, but JavaScript is an interpreter that just does things that you say to the console, not make a real picture.

My dad told me that he didn't think that JavaScript actually had that, so that's pretty much why I came here... to learn some other kind. Like, @jo_jo2000, we didn't even learn about console.log in there! How weird is that! Actually, I hadn't gone very far in it, so I may have not seen it... anyways, there's a lot more to be seen in here!

@albionsrefuge, he's talking about another website called KhanAcademy, which is a place that teaches math, science, about SAT tests, etc. It also shows some Intro to JS, which is really confusing, for it's really different than this. Here, I'll show you the link:

Check it out, okay?


#5

So many things that I'd like to discuss in that response :smile:

jQuery IS JavaScript -- it is a library of JavaScript commands that make some things easier for you.

You can see from my Codebit, that what I've done is JavaScript without the jQuery library. I have several other Codebits in there if you need more examples of drawing with JavaScript.

From MDN: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial

We had some fun last year with the extra activities in the Animate Your Name goal

Now, let's have a look at that Khan link. See how it says that they use ProcessingJS, that is another JavaScript library. You can visit the http://processingjs.org/ site to learn more about that. I'm going to guess that Khan has built an environment that allows you to use the ProcessingJS commands without having to worry about all the programming details.


#6

Hmmm... Interesting!:smiley:
Never heard about ProcessingJS before, haha. And about that:

I totally knew what I was talking about. :smiley:

And yeah, I'm guessing that Khanacademy did some shortcut or something to use ProcessingJS, now that I see what it is.