The following code won't load the green rectangle in the canvas. This is my very first time trying out jquery (either it sucks or me sucks), why such a simple thing is not working, I'm buffled. browser = ff3.6. thanks Playing with jquery because there's another jquery driven piece of code that could be quite useful...
<html> <head> <style type="text/css"> #canvas { border:1px solid black; } </style> <script type="text/javascript" src="/js/jquery-1.4.2.min.js"/> <script type="text/javascript"> // have also tried <script type="application/javascript"> $(function() { var canvas = $("#canvas")[0]; var ctx = canvas.getContext("2d"); // ctx.clearRect(0,0,300,300); ctx.fillStyle = "green"; ctx.fillRect(0,0,50,50); }); </script> </head> <body> <canvas id="canvas" width="300" height="300"> </body> </html>