Reputation: 13
i'm want to try paper.js so i make an html file like this :
<!DOCTYPE html>
<html>
<head>
<title>PAPERJS</title>
<script type="text/javascript" src="paper-core.js"></script>
<script type="text/paperscript" src="myscript.js" canvas="myCanvas">
</head>
<body>
<h1>paper js :</h1>
<canvas id="myCanvas" resize></canvas>
</body>
</html>
But it don't recognize the type="text/paperscript"
my file myscipt.js only contain this :
var myBall = new Path.Circle(new Point(70, 70), 50);
myBall.fillColor = 'tomato';
after this declaration nothing is happening in my html file when i try it :
<script type="text/paperscript" src="myscript.js" canvas="myCanvas">
Upvotes: 1
Views: 119
Reputation: 5308
If you want to use the "text/paperscript" type you must use "paper-full" not "paper-core". The paper-core file does not include the paperscript interpreter.
Upvotes: 1
Reputation: 962
Your problem is you missed the </script>
end tag
Scripts that have different type other than text/javascript
are not parsed by the html parser in browser but the paperscript type,you included are the custom type that the JS plugin for which you are including that particular type will run through your dom and use the content inside that file. (To be clearer)
Upvotes: 0