How does the CDN work?

As you probably know this:

doesn't work. Does anyone know how the CDN works? It will help if you show me the code without leaving out stuff.

Of course I tried the: A sample HTML page might look like this: under the start link on p5.js but of course it didn't work or else I wouldn't be here asking this question. I can use a CDN with bootstrap but this one doesn't work, any suggestions?

Thank you

Tagged:

Answers

  • edited February 2017 Answer ✓

    @tim50 -- Could you explain the question a bit more, and say what you mean specifically by "doesn't work"?

    On quick inspection the p5.js homepage provided URL from the Cloudflare CDN seems to be loading just fine...

    Does your test page work when you load p5.js locally rather than from the CDN?

  • When I put the CDN code in and then try to write a rect, it doesn't work. I notice when I go to this site: https://cdnjs.com/libraries/p5.js there are a bunch of snippets or whatever. Do I need to use one or more of them? If I use the code under where it says: A sample HTML page might look like this: if I put that code in my html, should I then have access to the P5 library like when you use bootstrap's CDN? Should it work? Or are there emore hoops? If I use that code, it doesn't work in terms of I can't get the code to work. If I put this in: ellipse(56, 46, 55, 55); I would not get an ellipse. I've moved the CDN around but that didn't do anything. I tried var canvas=ctx.getElementById("canvas").getContext("2d"); and with and without it, the code doesn't work... so what I mean is when I put the CDN in my html page, I don't get access to any of the P5. code stuff. I'm a noob.

    I have done some js with canvas. Do you think maybe I should just stay with that and not bother with P5 as I'm a noob? Can you use createLinearGradient with P5? That also doesn't work.

    Sorry for the long answer. I deleted P5 from my machine. I think I'm going to give up on it but if I could get the CDN to work, that would be great. I also ordered the book Getting Started with p5.js but I'm thinking I'll just get confused now.

    How does the CDN work like even if I could just get a rect?

  • edited March 2017

    Hi Jeremy, that second link you send me seems kind of big, especially for a NOOb like me. I'm having trouble understanding how this is simple while looking at the link. Do I cut and paste all that into my index.html?

Sign In or Register to comment.