Greetings! I am currently diving into the world of protovis, and things have been going well so far. However, I have encountered a problem that has me stumped.
Below is the code snippet I am working with. (I have ensured that the latest jquery is loaded in my headers)
<script type="text/javascript+protovis">
var dataURL = "http://eagereyes.org/media/2010/protovis-primer/earthquakes.json";
var JSONdata = $.ajax({ type: "GET", url: dataURL, async: false }).responseText;
var earthquakes = JSON.parse(JSONdata);
var width = 560;
var height = 245;
var barWidth = width/earthquakes.length;
var gap = 2;
new pv.Panel().width(width).height(height+5)
.add(pv.Bar)
.data(earthquakes)
.bottom(0)
.width(barWidth-gap)
.height(function(d) d.Magnitude * (height/9))
.left(function() this.index * barWidth)
.root.render();
Upon testing this in Firefox, I encountered the following alert:
Syntax: Error JSON.parse
I have already validated the JSON on . Therefore, it seems that the issue lies elsewhere.
Does anyone have any insights on what might be causing this error?
Edit
As an additional test, I tried loading the same data using the protoviewer app: , and it worked fine. This suggests that the issue may indeed be within the code itself.