javascript - How do I take code from Codepen, and use it locally? -
how take code codepen, , use locally in text-editor?
http://codepen.io/mfields/pen/bhilt
i trying have play creation locally, when open in chrome, blank white page nothing going on.
<!doctype html> <html> <head> <script> src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript" src="celtic.js"></script> <link rel="stylesheet" type="text/css" src="celtic.css"></link> </head> <body> <canvas id="animation" width="400" height="400"></canvas> </body> </html>
i have copy, pasted , saved css , js different files , saved them, tried link them html file have shown above.
i have included jquery library understand lot of codepen creations use it.
the console error i'm getting
uncaught typeerror: cannot read property 'getcontext' of null
which linking js file, line 4
(function(){ var canvas = document.getelementbyid( 'animation' ), c = canvas.getcontext( '2d' ),
sorry if dumb, i'm new this. i'm sure basic hell. awesome!
joe fitter right, think better export pen (use export export.zip option using pen locally). give working version of pen without having copy , paste css, javascript , html code , without having make changes on making work.
Comments
Post a Comment