I'm creating an HTML web-resource for CRM 2011 that is suppose to produce a custom graph. It works great on my local machine, but as soon as I put it into the CRM 2011 Solution, I get a JavaScript error on the line where I call getContext() on an element.
I've even gone so far as strip the code down to the most basic elements, and it still produces this error in CRM. Does anyone have any ideas? You can see the stripped down code below.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div style="width: 50%">
<canvas id="myChart" width="400" height="300"></canvas>
</div>
<script>
function loadData(dataSet) {
var c = document.getElementById("myChart");
var ctx = c.getContext(); //THIS IS THE LINE PRODUCING THE ERROR, BUT ONLY IN CRM 2011!!!
}
window.onload = function () {
loadData(1);
}
</script>
</body>
</html>