I'm trying to compare json data being streamed in from websockets.
An array like this would work flawlessly:
["stream","apple","orange"]
But an array of arrays not so well:
[["stream","apple","orange"],["stream","pear","kiwi"],["stream","apple","juice"]]
Any help would be greatly appreciated. Thanks in advance!
function handler(jsonString) {
var json = jQuery.parseJSON(jsonString);
if (json[0] == "blah") {
//Do something
}
else if (json[0] == "blah2") {
//Do something else
}
}