Level 4
When I added defer to included scripts it works, but maybe can someone explain why it didn't work?
I am talking about fabric.js library
That library works fine when i run it outside Laravel, when I include it in the view it simply does not work. That code works perfectly:
<canvas class="" id="c2"></canvas>
<script>
var canvas = new fabric.Canvas('c2');
var triangle = new fabric.Triangle({ left:50,
angle: 30,
width:50,
height:30,
selectable:false,
angle:40 });
canvas.add(triangle);
</script>
But if I run it inside Laravel it just doesn't work. I have indeed the canvas in the view, I load fabric.js library and that script, it even shows errors if I have any. If I don't load fabric.js it shows 'fabric undefined').
Maybe someone had the same problem with that or any other library?
P.S Now i see that if I don't include js/app.js it does work. So it is kind of "biting" with boostrap js?
Please or to participate in this conversation.