Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ajax, JSON and googlecharts..oh MY!
Message
From
09/07/2014 10:41:51
 
 
General information
Forum:
Javascript
Category:
JQuery
Miscellaneous
Thread ID:
01603355
Message ID:
01603403
Views:
43
>>Has anyone messed with GoogleCharts and Ajax?
>>
>
>What's the eval() doing there ? Since you're converting the response to a string then JSON.Parse(AjaxData) would seem to make more sense ?
>
>Also you are specifying a dataType : string which I didn't think exists - I certainly don't see it in the documentation. A valid dataType will override the contentType: application/json - don't know whether 'string' would.
>
>What comes over the wire from the server ? Why not drop the dataType and just get the json response which will automatically be parsed.

Dropped the dataType and eval and added a JSON.parse call

The data returning from the server is a string in the form I'm expecting to see when I check it after the Stored Proc call.

["colhead", "colhead2", etc],["hh:mm", n,n,n],["hh:mm",n,n], etc

AjaxData, however, shows up as "{"d":"[\"Time\",\"DB1\",\"DB2\",\"DB3\",\"DB4\"],[\"1:00\",54,50,57,47],[\"2:00\",56,46,63,20],etc,"}" String

JSON.parse(AjaxData) creates MyArray with a MyArray._proto_ and MyArray.d (where the data resides). I need that to be an array MyArray[0].

What am I not doing?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform