"reviver" is supposed to be a function (that you provide) that transforms 
every key/value pair in the JSON into the final javascript object.  It's 
useful for converting date strings into Date objects and stuff like that, 
but you probably don't have to worry about it.  There is no JSON.eval 
function - it is just eval.  I would avoid using that, though.

I think I see the problem, though.  You are missing the "new" keyword when 
you declare the DataTable.  It should be exactly like this:

var data = new google.visualization.DataTable(jsonData); 

or, if that doesn't work, this:

var data = new google.visualization.DataTable(JSON.parse(jsonData)); 

Either way, the "new" keyword is critically important.

On Wednesday, September 5, 2012 1:40:35 AM UTC-4, Diana Flores wrote:
>
> My server says:
>
> json support enabled json version 1.2.1 
> im using as server the wamp server!,  but i think its something with my 
> json!!!, cause i used:
>
>  var data = google.visualization.DataTable(JSON.parse(jsonData, reviver));
>  var data = google.visualization.DataTable(JSON.parse(jsonData));
>  var data = google.visualization.DataTable(JSON.eval('('+ jsonData +')'));
>
> and with the reviver and the eval, it says in the web console:
>
> JSON.eval is not a function
> reviver is not defined
>
> http://www.json.org/js.html a went here to know what JSON.parse can do!!!
>
>
> https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js
>
> On Tuesday, September 4, 2012 9:35:58 PM UTC-6, asgallant wrote:
>>
>> You're using firefox, right?  Check the web console instead of the error 
>> console (ctrl-shift-k in the windows version) to see if the JSON ends up 
>> there.
>>
>> If it is showing up properly, then since the type of jsonData is string, 
>> you may need to parse it before passing it to the DataTable constructor:
>>
>> var data = new google.visualization.DataTable(JSON.parse(jsonData)); 
>>
>> though in some browsers, this is not necessary.
>>
>> On Tuesday, September 4, 2012 9:36:54 PM UTC-4, Diana Flores wrote:
>>>
>>> hi, well i add what u say but what i got was a popup that says "string", 
>>> and in the console of error the same warning!!!
>>>
>>> On Monday, September 3, 2012 9:47:59 PM UTC-6, asgallant wrote:
>>>>
>>>> The json is fine.  Insert this line after the AJAX call and check the 
>>>> developer's console:
>>>>
>>>> alert(typeof(jsonData)); 
>>>> console.log(jsonData); 
>>>>
>>>> You should get a popup that says "object" and the developer's console 
>>>> should have the *exact* same json as your PHP page.
>>>>
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/6TCHJyj7uh0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to